By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,916 Members | 1,336 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,916 IT Pros & Developers. It's quick & easy.

Daylight saving

P: n/a
Is there any way to check whether daylight saving is enabled on a linux machine?
Nov 14 '05 #1
Share this Question
Share on Google+
14 Replies


P: n/a
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?

Nov 14 '05 #2

P: n/a
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)?

Nov 14 '05 #3

P: n/a
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

Nov 14 '05 #4

P: n/a
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.

Nov 14 '05 #5

P: n/a
>>>> 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

Nov 14 '05 #6

P: n/a

"Amitabh Deepak" <am************@wipro.com> 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.
Nov 14 '05 #7

P: n/a
Op Fri, 17 Sep 2004 18:45:30 +0100 schreef Malcolm:
"Amitabh Deepak" <am************@wipro.com> 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
Nov 14 '05 #8

P: n/a
On Fri, 17 Sep 2004 14:13:16 +0100, in comp.lang.c , Thes
<no***@ctualaddress.com> 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 =---
Nov 14 '05 #9

P: n/a
On Fri, 17 Sep 2004 18:45:30 +0100, in comp.lang.c , "Malcolm"
<ma*****@55bank.freeserve.co.uk> wrote:

"Amitabh Deepak" <am************@wipro.com> 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 =---
Nov 14 '05 #10

P: n/a
Mark McIntyre <ma**********@spamcop.net> wrote:
On Fri, 17 Sep 2004 18:45:30 +0100, in comp.lang.c , "Malcolm"
<ma*****@55bank.freeserve.co.uk> 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
Nov 14 '05 #11

P: n/a
On Mon, 20 Sep 2004 14:33:35 GMT, in comp.lang.c ,
rl*@hoekstra-uitgeverij.nl (Richard Bos) wrote:
Mark McIntyre <ma**********@spamcop.net> wrote:
On Fri, 17 Sep 2004 18:45:30 +0100, in comp.lang.c , "Malcolm"
<ma*****@55bank.freeserve.co.uk> 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 =---
Nov 14 '05 #12

P: n/a
Mark McIntyre <ma**********@spamcop.net> wrote:
On Mon, 20 Sep 2004 14:33:35 GMT, in comp.lang.c ,
rl*@hoekstra-uitgeverij.nl (Richard Bos) wrote:
Mark McIntyre <ma**********@spamcop.net> 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
Nov 14 '05 #13

P: n/a
On Wed, 22 Sep 2004 12:31:53 GMT, in comp.lang.c ,
rl*@hoekstra-uitgeverij.nl (Richard Bos) wrote:
Mark McIntyre <ma**********@spamcop.net> wrote:
On Mon, 20 Sep 2004 14:33:35 GMT, in comp.lang.c ,
rl*@hoekstra-uitgeverij.nl (Richard Bos) wrote:
>Mark McIntyre <ma**********@spamcop.net> 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 =---
Nov 14 '05 #14

P: n/a
Mark McIntyre <ma**********@spamcop.net> wrote:
On Wed, 22 Sep 2004 12:31:53 GMT, in comp.lang.c ,
rl*@hoekstra-uitgeverij.nl (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
Nov 14 '05 #15

This discussion thread is closed

Replies have been disabled for this discussion.