4
I’m having a hard time in Django returning the datetime in the local Timezone. No Django configurei USE_TZ=True
and TIME_ZONE = 'America/Sao_Paulo'
By calling timezone.now()
, returns the datetime with time in utc, do not know what the problem.
>>> print str(timezone.now().strftime('%z'))
+0000
My goal is to format the current datetime in the used by pagseguro, which is the 'YYYY-MM-DDThh:mm:ss.sTZD'
, who would be ex:'2015-02-26T01:40:000-03:00'
.
How could I solve this problem in Django in relation to Timezone and return formatted as pagseguro asks 'YYYY-MM-DDThh:mm:ss.sTZD'
?
Orion, Sorry for the somewhat off-topic comment to your question, but I see that you have followed the Super User proposal in English at Area 51, but have not yet made the commit. Then: http://area51.stackexchange.com/proposals/84282/super-user-em-portugues?referrer=4CYZyXbILZeSZMVw5WkVIw2
– Victor Stafusa
@Victor thought I committed, but now it’s done.
– Paulo