Skip to content

Instantly share code, notes, and snippets.

@akuraru
Created March 13, 2020 16:00
Show Gist options
  • Save akuraru/917742e1c296a4409dfe7f1b92ce7eec to your computer and use it in GitHub Desktop.
Save akuraru/917742e1c296a4409dfe7f1b92ce7eec to your computer and use it in GitHub Desktop.
カレンダーの調査
gregorian Saturday, March 14, 2020 at 12:55:29 AM Japan Standard Time
buddhist Saturday, March 14, 2563 BE at 12:55:29 AM Japan Standard Time
chinese Saturday, Second Month 21, 2020(geng-zi) at 12:55:29 AM Japan Standard Time
coptic Saturday, Baramhat 5, 1736 ERA1 at 12:55:29 AM Japan Standard Time
ethiopicAmeteMihret Saturday, Megabit 5, 2012 ERA1 at 12:55:29 AM Japan Standard Time
ethiopicAmeteAlem Saturday, Megabit 5, 7512 ERA0 at 12:55:29 AM Japan Standard Time
hebrew Saturday, 18 Adar 5780 at 12:55:29 AM Japan Standard Time
iso8601 Saturday, March 14, 2020 at 12:55:29 AM Japan Standard Time
indian Saturday, Phalguna 24, 1941 Saka at 12:55:29 AM Japan Standard Time
islamic Saturday, Rajab 20, 1441 AH at 12:55:29 AM Japan Standard Time
islamicCivil Saturday, Rajab 19, 1441 AH at 12:55:29 AM Japan Standard Time
japanese Saturday, March 14, 2 Reiwa at 12:55:29 AM Japan Standard Time
persian Saturday, Esfand 24, 1398 AP at 12:55:29 AM Japan Standard Time
republicOfChina Saturday, March 14, 109 Minguo at 12:55:29 AM Japan Standard Time
islamicTabular Saturday, Rajab 20, 1441 AH at 12:55:29 AM Japan Standard Time
islamicUmmAlQura Saturday, Rajab 19, 1441 AH at 12:55:29 AM Japan Standard Time
let ids: [Calendar.Identifier] = [
.gregorian,
.buddhist,
.chinese,
.coptic,
.ethiopicAmeteMihret,
.ethiopicAmeteAlem,
.hebrew,
.iso8601,
.indian,
.islamic,
.islamicCivil,
.japanese,
.persian,
.republicOfChina,
.islamicTabular,
.islamicUmmAlQura,
]
let date = Date()
let formatter = DateFormatter()
formatter.dateStyle = .full
formatter.timeStyle = .full
for id in ids {
formatter.calendar = Calendar(identifier: id)
print(id, formatter.string(from: date))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment