Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #72853 > unrolled thread
| Started by | Strae <daniele.pignedoli@gmail.com> |
|---|---|
| First post | 2014-06-06 08:37 -0700 |
| Last post | 2014-06-06 20:29 +0200 |
| Articles | 3 — 2 participants |
Back to article view | Back to comp.lang.python
Da dove prende python il default timezone? Strae <daniele.pignedoli@gmail.com> - 2014-06-06 08:37 -0700
Re: Da dove prende python il default timezone? Strae <daniele.pignedoli@gmail.com> - 2014-06-06 08:37 -0700
Re: Da dove prende python il default timezone? Andrea D'Amore <anddamNOALPASTICCIODICARNE+gruppi@brapi.net> - 2014-06-06 20:29 +0200
| From | Strae <daniele.pignedoli@gmail.com> |
|---|---|
| Date | 2014-06-06 08:37 -0700 |
| Subject | Da dove prende python il default timezone? |
| Message-ID | <3aff2999-5e30-44eb-84c0-5bb5cf92374a@googlegroups.com> |
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 ;)
[toc] | [next] | [standalone]
| From | Strae <daniele.pignedoli@gmail.com> |
|---|---|
| Date | 2014-06-06 08:37 -0700 |
| Message-ID | <596bdb79-78b1-4fe1-9292-29b56d4adf90@googlegroups.com> |
| In reply to | #72853 |
Whoops sorry, i thought this was the italian group
[toc] | [prev] | [next] | [standalone]
| From | Andrea D'Amore <anddamNOALPASTICCIODICARNE+gruppi@brapi.net> |
|---|---|
| Date | 2014-06-06 20:29 +0200 |
| Message-ID | <lmt19i$ed0$1@virtdiesel.mng.cu.mi.it> |
| In reply to | #72853 |
On 2014-06-06 15:37:24 +0000, Strae said:
> 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.
--
Andrea
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web