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.026 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'url:sourceforge': 0.03; 'locale': 0.07; 'received:mail-qc0-f174.google.com': 0.09; 'timestamp': 0.09; 'subject:issue': 0.16; 'url:py3k': 0.16; 'sender:addr:gmail.com': 0.18; 'variable': 0.20; 'regardless': 0.21; 'header:In-Reply-To:1': 0.25; 'setting': 0.26; 'values': 0.26; 'message-id:@mail.gmail.com': 0.27; 'correct': 0.28; 'url:python': 0.32; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'server': 0.35; 'skip:l 30': 0.35; 'received:209.85': 0.35; 'url:org': 0.36; 'url:library': 0.36; 'received:209': 0.37; 'received:209.85.216': 0.37; 'subject:: ': 0.38; 'some': 0.38; 'url:docs': 0.38; 'to:addr:python.org': 0.39; 'where': 0.40; 'header:Received:5': 0.40; 'your': 0.60; 'save': 0.61; 'hours': 0.66; 'greek': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=hPScWWF9gGCczOHTX5YPWjdL62D5gDRbb6C03HBlcW8=; b=05pV14zJNPjlrtCtRvECjO5sx14Xb3Xy7hQnTZCnxi4xQnxKewfVdHU4fL4wJNd5JS i4qWU7mEo4YyynRrjBJUWlXC0dxjMh9yud7GqeXwJ+Gl7KY3IPHmqMRayblRVLp0NoeT 6Km5l5qxH24bSPRdFU82i8fGU0MmDanECprasU3ZPGJkmL4YDlbBHcApJPsAZsFjITu2 Dh+Y9CRUXIGdeZonOaqrf8VZ6lT3qNug6aw7dDeZAtowRnwBH8205RgnQ9S1Ne3YcWJx cXgONi/ojmFBWViA/CK2LIGlk4TfrMOd8RCmB5UO6Egl8cRzZuY1sdLVjL0RMxgT0v58 jozg== MIME-Version: 1.0 Sender: jsf80238@gmail.com In-Reply-To: References: Date: Sat, 15 Sep 2012 12:58:13 -0600 X-Google-Sender-Auth: Km0cKw2BgFkNbU_tADAEOz2cVVk Subject: Re: datetime issue From: Jason Friedman To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 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: , Newsgroups: comp.lang.python Message-ID: Lines: 16 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1347735495 news.xs4all.nl 6861 [2001:888:2000:d::a6]:45880 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:29271 > # get some enviromental values > locale.setlocale(locale.LC_ALL, 'el_GR') > date = datetime.datetime.now().strftime( '%y-%m-%d %H:%M:%S' ) > > although iam setting greek as locale the time is 8 hours before, like in texas, us > How can i change this to save the correct Greek time in variable $date ? http://docs.python.org/py3k/library/datetime.html#tzinfo-objects http://stackoverflow.com/questions/117514/how-do-i-use-timezones-with-a-datetime-object-in-python http://pytz.sourceforge.net/ Reading these links suggests that datetime.now() will return the system time regardless of your locale setting. Use a timezone to generate a timestamp for someplace other than where your server sits.