Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!ecngs!feeder2.ecngs.de!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'configure': 0.04; 'locale': 0.07; 'sep': 0.09; 'span': 0.09; 'to:addr:comp.lang.python': 0.09; 'cc:addr:python-list': 0.10; 'charset:iso-8859-7': 0.15; 'properly': 0.15; 'sat,': 0.15; 'subject:issue': 0.16; 'wrote:': 0.17; 'pointed': 0.17; 'variable': 0.20; 'otherwise,': 0.20; 'of.': 0.22; 'skip:% 10': 0.22; 'cheers,': 0.23; '15,': 0.23; 'cc:no real name:2**0': 0.24; 'cc:2**1': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply- To:1': 0.25; 'header:User-Agent:1': 0.26; 'setting': 0.26; 'values': 0.26; 'am,': 0.27; 'cc:addr:gmail.com': 0.27; 'correct': 0.28; 'chris': 0.28; 'didnt': 0.29; 'this.': 0.29; 'received:google.com': 0.34; 'jason': 0.35; 'skip:l 30': 0.35; 'too.': 0.35; 'received:209.85': 0.35; 'but': 0.36; 'should': 0.36; 'enough': 0.36; 'received:209': 0.37; 'subject:: ': 0.38; 'some': 0.38; 'several': 0.39; 'where': 0.40; 'matter': 0.61; 'save': 0.61; 'wide': 0.62; 'hours': 0.66; 'communities,': 0.84; 'greek': 0.84 Newsgroups: comp.lang.python Date: Sat, 15 Sep 2012 12:26:53 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=94.68.84.56; posting-account=DYJQ-woAAACEPH85Au2BhUVfFTfSfVa4 References: User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-IP: 94.68.84.56 MIME-Version: 1.0 Subject: Re: datetime issue From: =?ISO-8859-7?B?zenq/Ovh7/Igyu/98eHy?= To: comp.lang.python@googlegroups.com Content-Type: text/plain; charset=ISO-8859-7 Content-Transfer-Encoding: quoted-printable Cc: =?ISO-8859-7?B?zenq/Ovh7/Igyu/98eHy?= , python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Message-ID: Lines: 63 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1347737215 news.xs4all.nl 6986 [2001:888:2000:d::a6]:55668 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:29274 =D4=E7 =D3=DC=E2=E2=E1=F4=EF, 15 =D3=E5=F0=F4=E5=EC=E2=F1=DF=EF=F5 2012 10:= 05:49 =EC.=EC. UTC+3, =EF =F7=F1=DE=F3=F4=E7=F2 Chris Rebert =DD=E3=F1=E1= =F8=E5: > On Sat, Sep 15, 2012 at 10:33 AM, =CD=E9=EA=FC=EB=E1=EF=F2 =CA=EF=FD=F1= =E1=F2 wrote: >=20 > > Hello again, >=20 > > >=20 > > one small matter too. >=20 >=20 >=20 > > # get some enviromental values >=20 > > locale.setlocale(locale.LC_ALL, 'el_GR') >=20 > >=20 > > date =3D datetime.datetime.now().strftime( '%y-%m-%d %H:%M:%S' ) >=20 > > >=20 > > although iam setting greek as locale >=20 >=20 >=20 > Locales don't affect timezones. Otherwise, how would expatriate >=20 > communities, or countries wide enough to span several timezones, >=20 > properly configure their software? >=20 >=20 >=20 > > the time is 8 hours before, like in texas, us >=20 >=20 >=20 > Which is where HostGator operates out of. >=20 >=20 >=20 > > How can i change this to save the correct Greek time in variable $date = ? >=20 >=20 >=20 > Use the `pytz` package that Jason pointed out. >=20 >=20 >=20 > Cheers, >=20 > Chris I did read but wasnt able to set it to greek time. Please tell me how should i write this. date =3D datetime.datetime.now().strftime( '%y-%m-%d %H:%M:%S',gmt+2 ) didnt work out for me.