Skip to main content

Ralsina.Me — Roberto Alsina's website

And the real problem is...

That date pars­ing is aw­ful. Yes, I can just try strp­ti­me() with dif­fer­ent for­mats un­til one work­s, but look at this:

from time import *
strptime(strftime('%Z',localtime()),'%Z')
Traceback (most recent call last):
  File "stdin", line 1, in ?
ValueError: unconverted data remains: 'ART'

Now, what that is sup­posed to do, as far as I un­der­stand, is print my time­zone (that is the strf­time cal­l, it prints ART), and then parse it back (that is the strp­time cal­l, and it fail­s).

Maybe %Z is new... no, it is­nt. It is in the ref­er­ence guide for 2.2.2 (what I use).


Contents © 2000-2024 Roberto Alsina