473,765 Members | 2,001 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Daylight saving

Is there any way to check whether daylight saving is enabled on a linux machine?
Nov 14 '05 #1
14 5538
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(cons t 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***@ctualadd ress.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(cons t 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.u k> 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

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
30150
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
4092
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 reporting UTC + 1 hour. Is this a bug or is there a way I can querey for daylight time and make the adjustment in my application? Thanks.
6
8843
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 when DST is in effect. This has been working fine for years, but I am worried about the upcoming change in 2007 in the US, which will be followed by a number of Canadian provices (where my application is used). The function that I use is very...
0
1511
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 didnt know if .NET was equipped with the new changes President Bush made with respect to Daylight Saving Time increase starting 2007. I could have found out by trying ..NET functions, only if I wasnt a lousy syntax scavanger. Here goes:
1
3222
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 -05:00, Chicago) Pacific Daylight Time (GMT -07:00, San Francisco) Using C# I know how to detect if Daylight saving time is applied or not
1
4529
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 -05:00, Chicago) Pacific Daylight Time (GMT -07:00, San Francisco) Using C# I know how to detect if Daylight saving time is applied or not
1
2001
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 new daylight saving time change that goes into effect 2007/03/11. This is a .Net application with thousands of lines of c#, javascript and html. As I currently understand it, relevant patches will be supplied and applied to the affected web...
2
2143
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 saving. So the question is how to check the PC is daylight saving or not? can anyone know this piece code to handle this problem? Thanks in advance, Martin
27
6889
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 test the time zone offset on a variety of dates to see if it changes. Based on that, I developed the following checkDST() function which, as far as I can tell, should be sufficient. It checks either the date passed to it or the current date with...
0
9568
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9398
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9951
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9832
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8831
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7378
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5275
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3531
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.