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

Inconsistent time zone

Hi all,

I have a utility that uses the C library function strftime() to return the
time zone name, but it returns "GMT Standard Time" on one computer, and
"BST" (which it should be at the moment) on the other computer.

Both PCs are Windows XP Pro Service Pack 2. Both have their time zone set to
GMT +0 (London). And in the Date & Time control panel applet, both show "GMT
Standard Time" as the Current time zone. Both have the correct date and time
values.

Can anyone suggest what's going wrong here?

Regards,
Neil
--------------------------------------------
Neil Carter Psychology Department
IT Technician University of Wales Swansea
Wales, United Kingdom

http://psy.swansea.ac.uk/staff/Carter/
Nov 14 '05 #1
5 2272
Daylight Saving Time box ticked?

Swansea University Psychology wrote:
Hi all,

I have a utility that uses the C library function strftime() to return the
time zone name, but it returns "GMT Standard Time" on one computer, and
"BST" (which it should be at the moment) on the other computer.

Both PCs are Windows XP Pro Service Pack 2. Both have their time zone set to
GMT +0 (London). And in the Date & Time control panel applet, both show "GMT
Standard Time" as the Current time zone. Both have the correct date and time
values.

Can anyone suggest what's going wrong here?

Regards,
Neil
--------------------------------------------
Neil Carter Psychology Department
IT Technician University of Wales Swansea
Wales, United Kingdom

http://psy.swansea.ac.uk/staff/Carter/


Nov 14 '05 #2
> Swansea University Psychology wrote:
I have a utility that uses the C library function strftime() to return
the time zone name, but it returns "GMT Standard Time" on one computer,
and "BST" (which it should be at the moment) on the other computer.


"Bob I" <bi*****@yahoo.com> wrote in message
news:41**************@yahoo.com...
Daylight Saving Time box ticked?


Yup! Any other ideas?!

Neil
--------------------------------------------
Neil Carter Psychology Department
IT Technician University of Wales Swansea
Wales, United Kingdom

http://psy.swansea.ac.uk/staff/Carter/
Nov 14 '05 #3
"Neil Carter" <ps****@swansea.ac.uk> wrote in message
news:cl**********@news.swman.net.uk...
Swansea University Psychology wrote:
I have a utility that uses the C library function strftime() to return
the time zone name, but it returns "GMT Standard Time" on one computer,
and "BST" (which it should be at the moment) on the other computer.

"Bob I" <bi*****@yahoo.com> wrote in message
news:41**************@yahoo.com...
Daylight Saving Time box ticked?


Yup! Any other ideas?!


I managed to resolve this by unchecking the Automatically adjust option
checkbox in Date and Time properties (on the machine returning GMT Standard
Time), then clicking OK to close the dialog box, then going back into the
dialog box and rechecking the checkbox and clicking OK again. Strftime("%Z")
on that machine now returns GMT Daylight Time.

The strange thing is that strftime() on the other machine (this machine, in
fact) returns BST.

There are other puzzling things... This machine returns BST even though it
(incorrectly) shows GMT Standard Time in the Date and Time dialog box.

Also, when I turned off the auto-adjust option on the other machine, the
clock did not change its time, but when I tried it on this machine, it went
back one hour. Furthermore, since I tried the same uncheck-check procedure
on this machine, the dialog box now shows GMT Daylight Time, yet strftime()
still returns BST!

Weird.
Neil
--------------------------------------------
Neil Carter Psychology Department
IT Technician University of Wales Swansea
Wales, United Kingdom

http://psy.swansea.ac.uk/staff/Carter/
Nov 14 '05 #4
"Neil Carter" <ps****@swansea.ac.uk> wrote:
"Neil Carter" <ps****@swansea.ac.uk> wrote:
Swansea University Psychology wrote:
I have a utility that uses the C library function
strftime() to return the time zone name, but it
returns "GMT Standard Time" on one computer,
Greenwich Mean Time Standard Time? What an odd thing to return
and "BST" (which it should be at the moment) on the other computer.

At least one of them says something useful..
I managed to resolve this by unchecking the Automatically adjust option
checkbox in Date and Time properties (on the machine returning GMT Standard
Time), then clicking OK to close the dialog box, then going back into the
dialog box and rechecking the checkbox and clicking OK again. Strftime("%Z")
on that machine now returns GMT Daylight Time.
There is no such thing as Greenwich Mean Time Daylight Time.
To quote from www.greenwichmeantime.com,

It is the same all year round and is not effected(sic)
by Summer Time or Daylight saving Time.

GMT is the mean (averaging out of minor variations over a year)
time that the sun crosses the Greenwich meridian. To suggest that
it changes for summer would be to suggest that the earth stops
rotating for an hour when the time kicks in, or something
equally absurd.
Also, when I turned off the auto-adjust option on the other machine, the
clock did not change its time, but when I tried it on this machine, it went
back one hour. Furthermore, since I tried the same uncheck-check procedure
on this machine, the dialog box now shows GMT Daylight Time, yet strftime()
still returns BST!


You are not the first person to be exasperated by the
behaviour of the Windows API. Probably a better place
to ask followup questions would be to a Windows
programming newsgroup, or a Windows XP group.
Nov 14 '05 #5
On Fri, 22 Oct 2004 10:55:40 +0100, "Swansea University Psychology"
<ps****@swansea.ac.uk> wrote:
I have a utility that uses the C library function strftime() to return the
time zone name, but it returns "GMT Standard Time" on one computer, and
"BST" (which it should be at the moment) on the other computer.
Per followup, un&reticking "Adjust for DST" changed to "GMT Daylight".
Both PCs are Windows XP Pro Service Pack 2. Both have their time zone set to
GMT +0 (London). <snip>


What runtime are you using? E.g. is your program compiled with MSVC*
(uses M$ library -- static or dynamic?); mingw (_mostly_ M$ library);
cygwin (its own pseudo-Unix library); something else (?).

If the M$ library, does (only) the second system have an environment
variable TZ set, either globally (in Control Panel / System) or in the
process where your app is run (perhaps by a .BAT file)? At least in my
limited testing, that overrides the OS setting.

- David.Thompson1 at worldnet.att.net
Nov 14 '05 #6

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

Similar topics

2
by: MLH | last post by:
I would like to be able to look up any 5-digit ZIP in a table that would show the correct time zone for the area. For example, I would like to look up 91915 in the table and see something that...
3
by: Jon Davis | last post by:
The date string: "Thu, 17 Jul 2003 12:35:18 PST" The problem: // this fails on PST DateTime myDate = DateTime.Parse("Thu, 17 Jul 2003 12:35:18 PST"); Help? Jon
10
by: Marc Pelletier | last post by:
Hello, I am writing an application that does some simple astronomical calculations. One of the variables I need is the number of hours passed in this year. I've written the following function ...
2
by: Avi | last post by:
I have a problem to get the different time zone's name for example I need the name of time zone UTC + 4:30 ("Kabul") The TimeZone.CurrentTimeZone get my current time zone name and I couldn't...
1
by: Clodoaldo Pinto Neto | last post by:
Hi all, I want to have the time zone string (like 'BRT') displayed after a date-time. The date column is of the type timestamp with time zone. But the time zone is not displayed. It works for...
14
by: Cesar Ronchese | last post by:
Hello! I've built a program that show some dates to users. I got a problem when users have different configured time zone machines, where: - One machine that determined time zone the date...
2
by: Mike | last post by:
I'm writing an application for Windows XP Embedded. This application requires that the user be able to change the time zone from within the application. I'm trying to do this using...
3
by: Satish Itty | last post by:
Hi all, I have a big problem in my hands and not sure how I can fix this. Any suggestions would be greatly appreciated. I have a .NET 3 tier app developed in VS2003 and .NET 1.1. the client is a...
7
by: Steve | last post by:
Hi All I have a windows application written in VB.net 2005 The users have to select a State of Australia, which I use to check they have the correct windows time zone selected in control panel...
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
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
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.