Daylight saving

Discussion in 'C Programming' started by Amitabh Deepak, Sep 17, 2004.

  1. Is there any way to check whether daylight saving is enabled on a linux machine?
    Amitabh Deepak, Sep 17, 2004
    #1
    1. Advertising

  2. Amitabh Deepak

    Amit Guest

    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?
    Amit, Sep 17, 2004
    #2
    1. Advertising

  3. Amitabh Deepak

    Thes Guest

    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)?
    Thes, Sep 17, 2004
    #3
  4. 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
    Michel Bardiaux, Sep 17, 2004
    #4
  5. Amitabh Deepak

    Thes Guest

    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.
    Thes, Sep 17, 2004
    #5
  6. Amitabh Deepak

    Michael Mair Guest

    >>>> 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
    Michael Mair, Sep 17, 2004
    #6
  7. Amitabh Deepak

    Malcolm Guest

    "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.
    Malcolm, Sep 17, 2004
    #7
  8. Amitabh Deepak

    Coos Haak Guest

    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
    Coos Haak, Sep 17, 2004
    #8
  9. 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 =---
    Mark McIntyre, Sep 18, 2004
    #9
  10. 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 =---
    Mark McIntyre, Sep 18, 2004
    #10
  11. Amitabh Deepak

    Richard Bos Guest

    Mark McIntyre <> wrote:

    > On Fri, 17 Sep 2004 18:45:30 +0100, in comp.lang.c , "Malcolm"
    > <> wrote:
    >
    > >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!


    Been reading Discworld, have we, Mark? :)

    Richard
    Richard Bos, Sep 20, 2004
    #11
  12. On Mon, 20 Sep 2004 14:33:35 GMT, in comp.lang.c ,
    (Richard Bos) wrote:

    >Mark McIntyre <> wrote:
    >
    >> On Fri, 17 Sep 2004 18:45:30 +0100, in comp.lang.c , "Malcolm"
    >> <> wrote:
    >>
    >> >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!

    >
    >Been reading Discworld, have we, Mark? :)


    Got 'em all on my Palmpilot, and I sit on the train each evening listening
    to PM on Radio 4 (thats a news programme) and reading Pratchet, giggling
    insanely every so often... guaranteed to get a seat to myself every time.
    --
    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 =---
    Mark McIntyre, Sep 20, 2004
    #12
  13. Amitabh Deepak

    Richard Bos Guest

    Mark McIntyre <> wrote:

    > On Mon, 20 Sep 2004 14:33:35 GMT, in comp.lang.c ,
    > (Richard Bos) wrote:
    >
    > >Mark McIntyre <> wrote:
    > >
    > >> Hightly amusing, your wife is a big hippo!

    > >
    > >Been reading Discworld, have we, Mark? :)

    >
    > Got 'em all on my Palmpilot,


    Tsk, tsk... there are no legal Pratchett e-books.

    Richard
    Richard Bos, Sep 22, 2004
    #13
  14. On Wed, 22 Sep 2004 12:31:53 GMT, in comp.lang.c ,
    (Richard Bos) wrote:

    >Mark McIntyre <> wrote:
    >
    >> On Mon, 20 Sep 2004 14:33:35 GMT, in comp.lang.c ,
    >> (Richard Bos) wrote:
    >>
    >> >Mark McIntyre <> wrote:
    >> >
    >> >> Hightly amusing, your wife is a big hippo!
    >> >
    >> >Been reading Discworld, have we, Mark? :)

    >>
    >> Got 'em all on my Palmpilot,

    >
    >Tsk, tsk... there are no legal Pratchett e-books.


    I got 'em from some bloke selling sausages in a bun. He swore they were
    legal, copied bitwise by some monks in a monastery in the ramtops.

    Plus, legal wrangle coming up, I own them all on paper so I already paid...
    and here rests the case for the defence. .
    --
    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 =---
    Mark McIntyre, Sep 22, 2004
    #14
  15. Amitabh Deepak

    Richard Bos Guest

    Mark McIntyre <> wrote:

    > On Wed, 22 Sep 2004 12:31:53 GMT, in comp.lang.c ,
    > (Richard Bos) wrote:
    >
    > >Tsk, tsk... there are no legal Pratchett e-books.

    >
    > I got 'em from some bloke selling sausages in a bun. He swore they were
    > legal, copied bitwise by some monks in a monastery in the ramtops.
    >
    > Plus, legal wrangle coming up, I own them all on paper so I already paid...


    Hmmm... I don't think that argument will stand up in court in the UK...
    It might in the Netherlands, at least if you'd made the copy yourself,
    but I don't think "backup copy" falls under fair use in your country.

    Of course, you're not likely to get into trouble unless you sell them
    on.

    Richard
    Richard Bos, Sep 23, 2004
    #15
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Pranav Kantawala
    Replies:
    5
    Views:
    734
    P.Hill
    Feb 25, 2004
  2. NoName NoName
    Replies:
    0
    Views:
    692
    NoName NoName
    Apr 12, 2004
  3. Michael Pfeifer
    Replies:
    4
    Views:
    377
    red floyd
    Dec 17, 2003
  4. Amitabh Deepak

    Daylight saving

    Amitabh Deepak, Sep 17, 2004, in forum: C++
    Replies:
    4
    Views:
    1,426
    AlanP
    Sep 17, 2004
  5. Filip Lyncker
    Replies:
    3
    Views:
    741
    Karl Heinz Buchegger
    Apr 5, 2005
Loading...

Share This Page