473,386 Members | 1,943 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,386 software developers and data experts.

time.strftime Timezone issue

I feel that the '%Z' format specifier from strftime() returns the wrong
value when daylight savings is in effect.

Today the following is always true:
time.strftime('%Z') == time.tzname[0]

Shouldn't it be:
time.strftime('%Z') == time.tzname[time.daylight]

-allen
Jul 18 '05 #1
1 2237
Never mind,

I just looked at Modules/timemodule.c and now I realize it that
time.strftime() is just a wrapper for the c library function of the same
name.

I guess I'll just live with my 'time.tzname[time.daylight]' code.

-allen
Allen Unueco wrote:
I feel that the '%Z' format specifier from strftime() returns the wrong
value when daylight savings is in effect.

Today the following is always true:
time.strftime('%Z') == time.tzname[0]

Shouldn't it be:
time.strftime('%Z') == time.tzname[time.daylight]

-allen

Jul 18 '05 #2

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

Similar topics

2
by: fowlertrainer | last post by:
Hello python-list, starttime=time.time() .... process .... endtime=time.time() dtime=endtime-starttime print "Started at:", time.strftime("%H:%M:%S",time.localtime(starttime)) print "Ended...
1
by: Roger Leigh | last post by:
I'd like to use standard C++ to process dates, converting to and from std::string and std::tm representations. The dates are going to/from a database, as ISO-8601 or SQL date-formatted strings. ...
3
by: Ilja Booij | last post by:
Hi all, I have some trouble with the following: I'm getting a time string, in YYYY-MM-DD HH:mm:ss format, which I need to translate into a string with DD-Mon-YYYY HH:mm:ss +HHMM, where the...
1
by: Benny Schudel | last post by:
hello I've tried to convert some milliseconds to a time format. $ms = 100000 // 1min 40sec echo strftime('%H:%M:%S', $ms/1000); i expect the result is: "00:01:40" but the result ist:...
3
by: bwooster47 | last post by:
Following python code prints out incorrect UTC Offset - the python docs say that %z is not fully supported on all platforms - but on Linux Fedora FC5, perl code works and python does not - is this...
2
by: mac11 | last post by:
I have a question about getting the current time. Here is a small program that just gets the time and displays it: #include <stdio.h> #include <time.h> #include <sys/time.h> #include <unistd.h>...
1
by: Matt | last post by:
Hi all, So a lot of digging on doing this and still not a fabulous solution: import time # this takes the last_modified_date naive datetime, converts it to a # UTC timetuple, converts that...
10
by: WebCM | last post by:
There is a function: http://paste.ubuntu.com/21865 It needs GMT date in YYYY-MM-DD HH:MM:SS format - in SQL: datetime. If date is the same as today, the function returns "Today". There is one...
3
by: R*a*h*u*L | last post by:
Hi, Can anyone help me out . Req: I have to convert one of my server Date/Time (timezone) which is in America/Denver to UTC or GMT time zone . I have tried the below but both gives me same...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.