Jan-03-2020, 07:54 AM
(Jan-02-2020, 11:07 PM)10OctNotOct10a1 Wrote: Why is it in year month day order? TIL Python dates are in the same order as the date in Japan.Maybe is something that common to use in Japan,but official national standards is
In my country, it's either year day month or day month year.
JIS X 0301
.ISO 8601
Quote:Extensions according to national standardsIf want more and better option for standard formats or time-zones use Pendulum
There is Japanese Industrial Standard JIS X 0301 (former JIS C 6262), and the translation ofISO 8601
isJIS X 0301
The date is represented in the basic format "YY.MM.DD"
(for example, the year, month, and day are separated by a hyphen , such as 2019-06-23
>>> import pendulum >>> >>> now = pendulum.now('Asia/Tokyo') >>> now DateTime(2020, 1, 3, 16, 36, 25, 399457, tzinfo=Timezone('Asia/Tokyo')) >>> print(now) 2020-01-03T16:36:25.399457+09:00 >>> # Example of different formats >>> print(now.to_rfc2822_string()) Fri, 03 Jan 2020 16:36:25 +0900 >>> print(now.to_rfc850_string()) Friday, 03-Jan-20 16:36:25 JST >>> print(now.to_rfc3339_string()) 2020-01-03T16:36:25.399457+09:00 >>> print(now.to_w3c_string()) 2020-01-03T16:36:25+09:00 >>> now.to_iso8601_string() '2020-01-03T16:36:25.399457+09:00'