daily pastebin goal
43%
SHARE
TWEET

Untitled

a guest Feb 24th, 2018 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Date {
  2.    
  3.     class func from(year: Int, month: Int , day: Int ) -> Date {
  4.         let gregorianCalendar = NSCalendar(calendarIdentifier: .gregorian)!
  5.        
  6.         var dateComponents   = DateComponents()
  7.         dateComponents.year  = year
  8.         dateComponents.month = month
  9.         dateComponents.day   = day
  10.        
  11.         let date = gregorianCalendar.date(from: dateComponents)!
  12.         return date
  13.     }
  14. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top