Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Daylight saving

Reply
Thread Tools

Daylight saving

 
 
Amitabh Deepak
Guest
Posts: n/a
 
      09-17-2004
Is there any way to check whether daylight saving is enabled on a linux machine?
 
Reply With Quote
 
 
 
 
Amit
Guest
Posts: n/a
 
      09-17-2004
This is not related to c.l.c.
man timezone will help!!


Amitabh Deepak wrote:

> Is there any way to check whether daylight saving is enabled on a linux machine?

 
Reply With Quote
 
 
 
 
Thes
Guest
Posts: n/a
 
      09-17-2004
Amit top-posted:
> Amitabh Deepak wrote:
>
>> Is there any way to check whether daylight saving is enabled on a
>> linux machine?

>
> This is not related to c.l.c.
> man timezone will help!!
>


Can you not check the tm_isdst member of the struct tm returned by
localtime(const time_t *tp)?

 
Reply With Quote
 
Michel Bardiaux
Guest
Posts: n/a
 
      09-17-2004
Thes wrote:

> Amit top-posted:
>
>> Amitabh Deepak wrote:
>>
>>> Is there any way to check whether daylight saving is enabled on a
>>> linux machine?

>>
>>
> > This is not related to c.l.c.
> > man timezone will help!!
> >

>
> Can you not check the tm_isdst member of the struct tm returned by
> localtime(const time_t *tp)?
>

Could you please quote the standard about localtime? I wish to compare
it with my (linux) man page for localtime.

HaND,
--
Michel Bardiaux
Peaktime Belgium S.A. Bd. du Souverain, 191 B-1160 Bruxelles
Tel : +32 2 790.29.41

 
Reply With Quote
 
Thes
Guest
Posts: n/a
 
      09-17-2004
Michel Bardiaux wrote:
> Thes wrote:
>
>> Amit top-posted:
>>
>>> Amitabh Deepak wrote:
>>>
>>>> Is there any way to check whether daylight saving is enabled on a
>>>> linux machine?
>>>
>>>
>>>
>> > This is not related to c.l.c.
>> > man timezone will help!!
>> >

>>
>> Can you not check the tm_isdst member of the struct tm returned by
>> localtime(const time_t *tp)?
>>

> Could you please quote the standard about localtime? I wish to compare
> it with my (linux) man page for localtime.
>
> HaND,


I'm afraid that I can't (hence the question mark in my post). There's
some info on K&R2 in the "Standard library" section - page 256, if that
helps.

Thes.

 
Reply With Quote
 
Michael Mair
Guest
Posts: n/a
 
      09-17-2004
>>>> Is there any way to check whether daylight saving is enabled on a
>>>> linux machine?
>>>
>>> This is not related to c.l.c.
>>> man timezone will help!!

>>
>> Can you not check the tm_isdst member of the struct tm returned by
>> localtime(const time_t *tp)?

>
> Could you please quote the standard about localtime? I wish to compare
> it with my (linux) man page for localtime.


7.23 Date and time <time.h>
7.23.1 Components of time

4 The range and precision of times representable in clock_t and time_t
are implementation-defined. The tm structure shall contain at least the
following members, in any order. The semantics of the members and their
normal ranges are expressed in the comments.

int tm_sec; // seconds after the minute [0, 60]
int tm_min; // minutes after the hour [0, 59]
int tm_hour; // hours since midnight [0, 23]
int tm_mday; // day of the month [1, 31]
int tm_mon; // months since January [0, 11]
int tm_year; // years since 1900
int tm_wday; // days since Sunday [0, 6]
int tm_yday; // days since January 1 [0, 365]
int tm_isdst; // Daylight Saving Time flag

The value of tm_isdst is positive if Daylight Saving Time is in effect,
zero if Daylight Saving Time is not in effect, and negative if the
information is not available.


.....

7.23.3.4 The localtime function

Synopsis 1
#include <time.h> struct tm *localtime(const time_t *timer);

Description 2 The localtime function converts the calendar time pointed
to by timer into a broken-down time, expressed as local time.

Returns 3 The localtime function returns a pointer to the broken-down
time, or a null pointer if the specified time cannot be converted to
local time.


Cheers
Michael

 
Reply With Quote
 
Malcolm
Guest
Posts: n/a
 
      09-17-2004

"Amitabh Deepak" <> wrote
>
> Is there any way to check whether daylight saving is enabled on a linux
> machine?
>

Switch on the computer, and watch until it comes to the Sunday after the
equinox. If the clock skips an hour, daylight saving is enabled.


 
Reply With Quote
 
Coos Haak
Guest
Posts: n/a
 
      09-17-2004
Op Fri, 17 Sep 2004 18:45:30 +0100 schreef Malcolm:

> "Amitabh Deepak" <> wrote
>>
>> Is there any way to check whether daylight saving is enabled on a linux
>> machine?
>>

> Switch on the computer, and watch until it comes to the Sunday after the
> equinox. If the clock skips an hour, daylight saving is enabled.


<OT>
The equinox is on 22 September, 16.30 UT
The daylight saving time ends in the early morning of 31 October.
You should know, UK is part of Europe!
In other countries this may be different
</OT>
--
Coos
 
Reply With Quote
 
Mark McIntyre
Guest
Posts: n/a
 
      09-17-2004
On Fri, 17 Sep 2004 18:45:30 +0100, in comp.lang.c , "Malcolm"
<> wrote:

>
>"Amitabh Deepak" <> wrote
>>
>> Is there any way to check whether daylight saving is enabled on a linux
>> machine?
>>

>Switch on the computer, and watch until it comes to the Sunday after the
>equinox. If the clock skips an hour, daylight saving is enabled.


Hightly amusing, your wife is a big hippo! This method doesn't work in
Arabia, Japan, Africa, south america, antarctica, the UK etc. Not unless
you also apply an unusual definition of Sunday or Equinox.

--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt>


----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
 
Reply With Quote
 
Mark McIntyre
Guest
Posts: n/a
 
      09-17-2004
On Fri, 17 Sep 2004 14:13:16 +0100, in comp.lang.c , Thes
<> wrote:

>Amit top-posted:
>> Amitabh Deepak wrote:
>>
>>> Is there any way to check whether daylight saving is enabled on a
>>> linux machine?

>>
> > This is not related to c.l.c.
> > man timezone will help!!
> >

>
>Can you not check the tm_isdst member of the struct tm returned by
>localtime(const time_t *tp)?


It has 3 values, "on", "off" and "I don't know, wretched isn't it?". So it
may (or may not) be helpful.

--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt>


----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to convert a given local time to UT considering Daylight Saving Times.... Filip Lyncker C++ 3 04-05-2005 02:52 PM
Daylight saving Amitabh Deepak C++ 4 09-17-2004 12:38 PM
Daylight saving 2004-10-31 03:00 EEST/EET? NoName NoName Java 0 04-12-2004 07:21 PM
Daylight Saving time: How to identify if a given time is invalid? Pranav Kantawala Java 5 02-25-2004 06:28 PM
Converting datetimes from/to UTC/GMT including daylight saving Michael Pfeifer C++ 4 12-17-2003 09:18 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57