473,398 Members | 2,525 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

why goes the time change after import statement ?

hi i am working on a S3 project and facing a really weird problem!
take a look at the following import statements and the time output
>>import time
time.strftime("%a, %d %b %Y %X GMT", time.gmtime())
'Sat, 02 Aug 2008 20:21:56 GMT'

# OK
>>import pygtk
time.strftime("%a, %d %b %Y %X GMT", time.gmtime())
'Sat, 02 Aug 2008 20:22:04 GMT'

# OK
>>import gtk
time.strftime("%a, %d %b %Y %X GMT", time.gmtime())
'Sat, 02 Aug 2008 08:22:11 PM GMT'

# HOW THE HELL THIS HAPPEN ??? not DATE_RFC2822 format gmt time !

i have waisted 3 hours trying to locate the source of this strange
problem.
so what i am asking is does anyone know to overwrite or fix the
defaurl behaviour strftime() ????
Aug 2 '08 #1
3 1133
On Aug 2, 10:35*pm, binaryjesus <coolman.gu...@gmail.comwrote:
hi i am working on a S3 project and facing a really weird problem!
take a look at the following import statements and the time output
>import time
time.strftime("%a, %d %b %Y %X GMT", time.gmtime())

'Sat, 02 Aug 2008 20:21:56 GMT'

# OK
>import pygtk
time.strftime("%a, %d %b %Y %X GMT", time.gmtime())

'Sat, 02 Aug 2008 20:22:04 GMT'

# OK
>import gtk
time.strftime("%a, %d %b %Y %X GMT", time.gmtime())

'Sat, 02 Aug 2008 08:22:11 PM GMT'

# HOW THE HELL THIS HAPPEN ??? not DATE_RFC2822 format gmt time !
Reading the manual page for strftime -- http://docs.python.org/lib/module-time.html
-- says that '%X' is the locale's appropriate time representation, so
obviously gtk is adjusting your locale. Perhaps use a formatting
string that doesn't depend on the locale: '%H:%M:%S' instead of '%X'
seems to give your preferred format.

--
Paul Hankin
Aug 2 '08 #2
On Aug 3, 1:46 am, Paul Hankin <paul.han...@gmail.comwrote:
On Aug 2, 10:35 pm, binaryjesus <coolman.gu...@gmail.comwrote:
hi i am working on a S3 project and facing a really weird problem!
take a look at the following import statements and the time output
>>import time
>>time.strftime("%a, %d %b %Y %X GMT", time.gmtime())
'Sat, 02 Aug 2008 20:21:56 GMT'
# OK
>>import pygtk
>>time.strftime("%a, %d %b %Y %X GMT", time.gmtime())
'Sat, 02 Aug 2008 20:22:04 GMT'
# OK
>>import gtk
>>time.strftime("%a, %d %b %Y %X GMT", time.gmtime())
'Sat, 02 Aug 2008 08:22:11 PM GMT'
# HOW THE HELL THIS HAPPEN ??? not DATE_RFC2822 format gmt time !

Reading the manual page for strftime --http://docs.python.org/lib/module-time.html
-- says that '%X' is the locale's appropriate time representation, so
obviously gtk is adjusting your locale. Perhaps use a formatting
string that doesn't depend on the locale: '%H:%M:%S' instead of '%X'
seems to give your preferred format.

--
Paul Hankin
ok that explain it.
but what command does gtk runs that it sets the default behaviour of
strfime() to that ?
Aug 3 '08 #3
On Aug 3, 8:12*am, binaryjesus <coolman.gu...@gmail.comwrote:
On Aug 3, 1:46 am, Paul Hankin <paul.han...@gmail.comwrote:
On Aug 2, 10:35 pm, binaryjesus <coolman.gu...@gmail.comwrote:
hi i am working on a S3 project and facing a really weird problem!
take a look at the following import statements and the time output
>import time
>time.strftime("%a, %d %b %Y %X GMT", time.gmtime())
'Sat, 02 Aug 2008 20:21:56 GMT'
# OK
>import pygtk
>time.strftime("%a, %d %b %Y %X GMT", time.gmtime())
'Sat, 02 Aug 2008 20:22:04 GMT'
# OK
>import gtk
>time.strftime("%a, %d %b %Y %X GMT", time.gmtime())
'Sat, 02 Aug 2008 08:22:11 PM GMT'
# HOW THE HELL THIS HAPPEN ??? not DATE_RFC2822 format gmt time !
Reading the manual page for strftime --http://docs.python.org/lib/module-time.html
-- says that '%X' is the locale's appropriate time representation, so
obviously gtk is adjusting your locale. Perhaps use a formatting
string that doesn't depend on the locale: '%H:%M:%S' instead of '%X'
seems to give your preferred format.

ok that explain it.
but what command does gtk runs that it sets the default behaviour of
strfime() to that ?
Maybe setlocale?

--
Paul Hankin
Aug 3 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: NeilS | last post by:
I'm developing under IIS V5.1 and testing on an ethernet with IIS hosted on WinXPPro. I am trying to implement file-upload using a polished version of the technique published in...
9
by: Adrian Dragomirescu | last post by:
Hello, I have the following problem: In my ASPX page is a button called "Import". The action of this button is to import a set of data in my database. I have to import big datasets and this...
9
by: KDawg44 | last post by:
Hi, I am brand new to Python. In learning anything, I find it useful to actually try to write a useful program to try to tackle an actual problem. I have a syslog server and I would like to...
1
by: Josef Dalcolmo | last post by:
Hello, I have tried this only on Windows XP. in Python 2.4 os.path.getmtime() used to return an integer representing the local time. in Python 2.5 os.path.getmtime() reports a float...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.