4 ms·
The datetime package is one of the best things about Python, and dare I say one of the best general purpose calendar modules ever written. It’s just so practica
by ericbarrett 6y ago
The datetime package is one of the best things about Python, and dare I say one of the best general purpose calendar modules ever written. It’s just so practical.
- BrandoElFollito 6y agoarrow (my favorite), pendulum or delorean are in my opinion much better (= easier to use, versatile, ...)
- sltkr 6y agoPython is great, but in this case, you could get almost identical output using bash alone: for t in {0..4100000000..100000000}; do TZ=UTC printf "%'13d - %(%Y-%m-%d %H:%M:%S)T\n" $t $t; done
- wwright 6y agoIt still can’t parse ISO8601 :(
- larkeith 6y ago`datetime.fromisoformat()`, as of 3.7 :D Though `dateutil` is still recommended for most cases.
- wwright 6y agoThat parses a subset and is only guaranteed to be compatible with Python’s “.toisoformat()”. (I imagine it would be backwards compatible to expand it to cover all of ISO8601 and I can’t tell why they haven’t.)
- londt8 6y agoISO8601 is quite large, they probably don't want to ship that big standard library modules which would parse 100% of ISO8601
- X6S1x6Okd1st 6y agoI found Go's quite good as well