473,624 Members | 2,245 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2250
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
2303
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 at:", time.strftime("%H:%M:%S",time.localtime(endtime)) #print time.localtime(dtime) print "Deltatime: ", time.strftime("%H:%M:%S",time.localtime(dtime))
1
9219
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. They will also be presented to the user in the correct format for their locale. I can't see a way to use ISO-8601 dates without resorting to non-standard GNU extensions (I'm using GNU libstdc++ and libc). Is this possible? I don't want to tie...
3
4510
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 last part is the timezone offset. I've tried to do it with the following function. This works for me, I get +0200 for the timezone part, which makes sense, because we're
1
12603
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: "01:01:40"
3
1810
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 a bug or is this expected behavior? For a EST timezone setup, Perl prints correct -0500, while Python prints +0000 - this is Python 2.4. Perl: $now_string = strftime "%Y-%m-%d %H:%M:%S %Z%z", localtime; print $now_string, "(iso local)\n";
2
2638
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> int main() { char buf;
1
4073
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 to a timestamp (seconds since the # epoch), subtracts the timezone offset (in seconds), and then converts
10
4011
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 problem. This function does not recognize time zones. How to adjust date to user's time zone? Is converting to timestamp() and then to format readable to visitors the one and only solution (e.g. strtotime() + date() OR DateTime object)? Perhaps,...
3
2748
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 date/time pl help. <?php
0
8170
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8619
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8334
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8474
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6108
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5561
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4078
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4173
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2604
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.