Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Timepiece

naoty
May 13, 2015

 Timepiece

naoty

May 13, 2015
Tweet

More Decks by naoty

Other Decks in Programming

Transcript

  1. 4QFDJpDEBUF J04 let now = NSDate() let calendar = NSCalendar.currentCalendar()

    let components = calendar.components(…, fromDate: now) components.year = 2014 components.month = 8 components.day = 15 components.hour = 20 components.minute = 25 components.second = 43 calendar.dateFromComponents(components)
  2. &OEPGUIJTNPOUI J04 let now = NSDate() let calendar = NSCalendar.currentCalendar()

    let lastDay = calendar.rangeOfUnit(.CalendarUnitDay, inUnit: .CalendarUnitMonth, forDate: now).length let components = calendar.components(…, fromDate: now) components.year = 2014 components.month = 8 components.day = lastDay components.hour = 20 components.minute = 25 components.second = 43 calendar.dateFromComponents(components)
  3. 'PSNBUEBUF J04 let threeDaysAgo = … let formatter = NSDateFormatter()

    formatter.dateFormat = “yyyy-MM-dd” formatter.stringFromDate(threeDaysAgo)
  4. )PXJUXPSLT w *OU 5JNFQJFDFTXJGU w EBZT%VSBUJPO  $BMFOEBS6OJU%BZ  w

    %VSBUJPOTXJGU w EBZTMBUFS/4%BUF w /4%BUF 5JNFQJFDFTXJGU w  MIT/4%BUF SIT%VSBUJPO /4%BUF