yes, your correct. This is what I want to, but with our settings the 2 times are exactly the same. What is the setting of your TZ env. variable?
-----Original Message----- From: Gerhard den Hollander [SMTP:gerhard@jasongeo.com] Sent: Wednesday, April 10, 2002 1:19 PM To: Berge, Harry ten Cc: SuSE general (E-mail) Subject: Re: [SLE] timezone question
* Berge, Harry ten
(Wed, Apr 10, 2002 at 11:25:56AM +0200) Hi,
We have an application which determines the timezone and if the daylight saving is active. To do this, the struct tm is used, and the functions localtime() and gmtime(). The problem is the application correctly says it is 'daylight saving active' for Solaris/Unix/WinNT, but for Linux not.
The system settings are:
GMT="--localtime" TIMEZONE="Europe/Amsterdam"
Has anyone an idea what whe are doing wrong?
#include
#include main() { struct tm * tm; time_t t; t = time(NULL); tm = gmtime(&t); printf("GMT: %s",asctime(tm)); printf("GMT: %d\n\n",tm->tm_isdst); tm = localtime(&t); printf("LOC: %s",asctime(tm)); printf("LOC: %d\n\n",tm->tm_isdst); }
gives GMT: Wed Apr 10 11:10:51 2002 GMT: 0
LOC: Wed Apr 10 13:10:51 2002 LOC: 1
which is exactly what I would expect .... or do you want asctime to say ``daylight savings time'' at the end ?
try strftime ...
Gerhard, <@jasongeo.com> == The Acoustic Motorbiker == -- __O If your watch is wound, wound to run, it will =`\<, If your time is due, due to come, it will (=)/(=) Living this life, is like trying to learn latin in a chines firedrill
-- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com
Also check the archives at http://lists.suse.com
* Berge, Harry ten
yes, your correct. This is what I want to, but with our settings the 2 times are exactly the same. What is the setting of your TZ env. variable?
% grep TIMEZONE /etc/rc.config TIMEZONE="Europe/Amsterdam" % grep GMT /etc/rc.config GMT="--localtime"
-----Original Message----- From: Gerhard den Hollander [SMTP:gerhard@jasongeo.com] Sent: Wednesday, April 10, 2002 1:19 PM To: Berge, Harry ten Cc: SuSE general (E-mail) Subject: Re: [SLE] timezone question
* Berge, Harry ten
(Wed, Apr 10, 2002 at 11:25:56AM +0200) Hi,
We have an application which determines the timezone and if the daylight saving is active. To do this, the struct tm is used, and the functions localtime() and gmtime(). The problem is the application correctly says it is 'daylight saving active' for Solaris/Unix/WinNT, but for Linux not.
The system settings are:
GMT="--localtime" TIMEZONE="Europe/Amsterdam"
Has anyone an idea what whe are doing wrong?
#include
#include main() { struct tm * tm; time_t t; t = time(NULL); tm = gmtime(&t); printf("GMT: %s",asctime(tm)); printf("GMT: %d\n\n",tm->tm_isdst); tm = localtime(&t); printf("LOC: %s",asctime(tm)); printf("LOC: %d\n\n",tm->tm_isdst); }
gives GMT: Wed Apr 10 11:10:51 2002 GMT: 0
LOC: Wed Apr 10 13:10:51 2002 LOC: 1
which is exactly what I would expect .... or do you want asctime to say ``daylight savings time'' at the end ?
try strftime ...
Kind regards, -- Gerhard den Hollander Phone :+31-10.280.1515 Global IT Support manager Direct:+31-10.280.1539 Jason Geosystems BV Fax :+31-10.280.1511 (When calling please note: we are in GMT+1) gdenhollander@jasongeo.com POBox 1573 visit us at http://www.jasongeo.com 3000 BN Rotterdam JASON.......#1 in Reservoir Characterization The Netherlands
This e-mail and any attachment is/are intended solely for the named addressee(s) and may contain information that is confidential and privileged. If you are not the intended recipient, we request that you do not disseminate, forward, distribute or copy this e-mail message. If you have received this e-mail message in error, please notify us immediately by telephone and destroy the original message.
participants (2)
-
Berge, Harry ten
-
Gerhard den Hollander