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

Problems with DST in tm Structure

Howdy, everyone...

I've read some reference books, checked some old
code I wrote and have done some Googling to try and
get 'round this but haven't had any joy...

The attached code works Ok... and I understand that both
time() and localtime() do some magic with DST (daylight
saving time) when converting the longword time value. This
explains why the ctime() value and (most) values in the
tm structure are correct. However, I DON'T understand why
tm_isdst is zero, even though we're in DST right now in
Melbourne, .au.

I thought it might have something to do with locale functions...
but I've read a few on-line articles that state that no
MS-DOS/MS-Win compiler actually supports setlocale() in any
way as everything's hardwired.

This almost seems to be correct as when I run this program
after changing the system date to "June", the tm_isdst value
shows as '1', which would be correct for a USA-based time zone.

I've also tried setting a TZ environment variable (TZ=AEST10AEDST)
but that doesn't seem to make any difference. I generally don't
have a TZ variable defined.

A sample output follows:

Current Local Time: Thu Feb 24 21:47:21 2005
As a longword: 1109245641
BEFORE Local Time: 21:47:21
Local tm_isdst: 0
AFTER Local Time: 21:47:21
Local tm_isdst: 0
Any suggestions? I've tried building the program with Borland C++
Builder v4 (command line version) and Digital Mars C++ compiler.
The program behaves the same on Windows 98 SE OEM and WinXP SP1.

Thanks.
John
Nov 14 '05 #1
0 1007

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

Similar topics

8
by: Steve Jorgensen | last post by:
Hi folks, I'm posting this message because it's an issue I come up against relatively often, but I can't find any writings on the subject, and I haven't been able to figure out even what key...
6
by: Jamal | last post by:
I am working on binary files of struct ACTIONS I have a recursive qsort/mergesort hybrid that 1) i'm not a 100% sure works correctly 2) would like to convert to iteration Any comments or...
2
by: njr | last post by:
Having copied a number of folders from my development PC (XP) to a development server (W2003) and installed them under wwwroot (and created applications in IIS) I have problems when I include the...
2
by: BigC | last post by:
Hi, I am having problems converting from a Structure to a ByteArray. The main problem being that the structure contains a variable length array, which cannot be defined within the structure...
1
by: Falko Wagner | last post by:
Hi there, I am currently translating a VB 6.0 application to .NET and have the following problem: The data structure I need to pass to a DLL function call has a structure variable inside its...
2
by: Jack Fox | last post by:
We are encountering a couple of problems with our ASP.NET / IIS 6.0 applications: In each of 3 production environments we maintain a Windows Server 2003 machine running NTFS as a file server....
2
by: Mike | last post by:
Hi, I am new to C and having problems with the following program. Basically I am trying to read some files, loading data structures into memory for latter searching. I am trying to use structres...
0
by: MikeCS | last post by:
Hi all I would like some help with this issue. I am new to VB 2005 (OK with VB6) My problem is that I cannot seem to return a structure from a function. Example: I defined a structure in a...
8
webroten
by: webroten | last post by:
I've been working through trying to access a C DLL from VB.NET. I've read many online postings, but I'm still having problems. Now, my error is the "Attempted to read or write protected memory"...
3
by: =?ISO-8859-1?Q?Jo=E3o_Maia?= | last post by:
Hi there, I am having a weird problem in trying to use a ASP.NET menu inside a custom web part. I am developing a custom web part that has a menu inside (just the menu, nothing else). The menu...
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: 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
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
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...
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
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
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...

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.