Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let identifiers: [Calendar.Identifier] = [.buddhist, .chinese, .coptic, .ethiopicAmeteAlem, .ethiopicAmeteMihret, .gregorian, .hebrew, .indian, .islamic, .islamicCivil, .islamicTabular, .islamicUmmAlQura, .iso8601, .japanese, .persian, .republicOfChina]
- identifiers.forEach {
- let calendar = Calendar(identifier: $0)
- let year = calendar.component(.year, from: Date())
- print("For: \(calendar.identifier) got: \(year)")
- }
- Output:
- For: buddhist got: 2565
- For: chinese got: 39
- For: coptic got: 1738
- For: ethiopicAmeteAlem got: 7514
- For: ethiopicAmeteMihret got: 2014
- For: gregorian got: 2022
- For: hebrew got: 5782
- For: indian got: 1944
- For: islamic got: 1443
- For: islamicCivil got: 1443
- For: islamicTabular got: 1443
- For: islamicUmmAlQura got: 1443
- For: iso8601 got: 2022
- For: japanese got: 4
- For: persian got: 1401
- For: republicOfChina got: 111
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement