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

Daylight saving

Is there any way to check whether daylight saving is enabled on a linux machine?
Nov 14 '05 #1
14 5499
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
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
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
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
>>>> 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

"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
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
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
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Drew | last post by:
Is there a way to check if it is daylight savings or not via c#? I have heard you can use System.Globalization? Thanks - Drew
7
by: Brett Edman | last post by:
I created a UTC clock using this: UTCTime = MyTime.ToUniversalTime() Now that we've turned the clocks ahead 1 hour for daylight savings time, the clock is reporting the wrong UTC time. It is...
6
by: Robm | last post by:
Since googling this issue only brings up the April fool's problem, which was solved years ago, I hope that somebody can help me with this. I have a large vc++/mfc application which needs to know...
0
by: Chirag Shukla | last post by:
Colleagues, I wanted to share a function to find if a date is in Daylight Saving Time or not. I was able to make this function faster than reading MSDN to find functions that .NET provides. I...
1
by: maflatoun | last post by:
Hi everyone, I have 3 different time zones that I'm working with. Basically converting from UTC to those 3 time zones. Eastern Daylight Time (GMT -04:00, New York) Central Daylight Time (GMT...
1
by: maflatoun | last post by:
Hi everyone, I have 3 different time zones that I'm working with. Basically converting from UTC to those 3 time zones. Eastern Daylight Time (GMT -04:00, New York) Central Daylight Time (GMT...
1
by: luke_airig | last post by:
I'm not sure if this is the right group for this posting. If not, please accept my apologies. I have been tasked with identifying and correcting application code that will be affected by the...
2
by: =?Utf-8?B?bWFydGluMQ==?= | last post by:
Hi, All, My app picks ccurrent time on the PC to retrieve data from sql DB, the Sql data is always data with non-daylight saving. The app runs on PC with both daylight saving and non-daylight...
27
by: RobG | last post by:
I was investigating a function to determine whether daylight saving was being observed on a particular date (given the platform's regional settings) and came across a suggestion at merlyn.com to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...

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.