Da dove prende python il default timezone?

S

Strae

Ho acquistato un server di test in canada; Installato debian 7, settato il timezone di Roma tramite dpkg-reconfigure tzdata e sembra tutto ok;

Però sembra che python di default prenda sempre il timezone canadese:

import os, time
from time import strftime
strftime("%H") # Le 18 sono le 23!

Ora, posso settare il timezone nello script, ma per impostarlo a livello "globale" come si fà?


Scusate se è una domanda scema ma con python sono moooolto alle prime armi ;)
 
A

Andrea D'Amore

Ho acquistato un server di test in canada; Installato debian 7, settato
il timezone di Roma tramite dpkg-reconfigure tzdata e sembra tutto ok;
Però sembra che python di default prenda sempre il timezone canadese

I'm on a very similar setup (Wheezy, server in USA, EU timezone) and my
strftime works as expected:

~> cat /etc/timezone
Europe/Rome
~> date "+%H"
20
~> python -c 'import time; print time.strftime("%H")'
20


Try reconfiguring tzdata package again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,477
Members
44,898
Latest member
BlairH7607

Latest Threads

Top