Sponsored Content
Operating Systems Linux Reading Daylight Saving Time in Linux using C/C++ Post 302382534 by suryaemlinux on Wednesday 23rd of December 2009 02:12:36 PM
Old 12-23-2009
Reading Daylight Saving Time in Linux using C/C++

Hi folks,
I would like to read the start date and end date of the Daylight Saving Time for the given timezone in the given year. What's the function in C/C++ to read the start of the Daylight Saving date and end of Daylight saving date?

I'm using Linux 2.6.xx Kernel.

For Example, in Pacific Time (US & Canada) the Daylight Start date for the year 2009 is Mar 9,2009 and it ended on Nov 1, 2009. I need a C/C++ function to read these dates.

Thanks in Advance,
Surya

Last edited by suryaemlinux; 12-23-2009 at 03:18 PM..
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Timestamp - confusion with daylight saving time

Hello! I'm currently working on a climatological dataset that uses unix-timestamp and a real date like 28/03/2004 02:45:00 h. in spring the unix-timestamp follows its continuos mode but in the column of the real date the time jumps one hour forward (e.g. from 1:59:59 to 3:00:00). i think this is... (1 Reply)
Discussion started by: softmachine
1 Replies

2. Solaris

disable daylight saving

hi ... i have an E450 sun server that is running solaris 6 . i want to disable daylight savings on my server . My question is : 1) how to know that my server is running daylight savings ? 2) how to disable it ? my zoneinfo file contains the following # @(#)init.dfl 1.2 92/11/26 # #... (1 Reply)
Discussion started by: ppass
1 Replies

3. AIX

Daylight Saving Time patch test

On AIX 5.1, after applying a DST patch or workaround, is there a way to test that the DST changes have taken effect? (1 Reply)
Discussion started by: dangral
1 Replies

4. HP-UX

How to set the Daylight Saving Time (DST) OFF

I have a problem with the time so I need to set the DST to be OFF. is anybody can show me how to set the DST to be OFF? (11 Replies)
Discussion started by: Billy_yuli
11 Replies

5. UNIX for Dummies Questions & Answers

Daylight saving not working properly with linux-2.6. kernel

The daylight saving action is not working Time zone was set for that Australia(parth) and issued reboot. Now for DST, (Daylight Saving Time): For 29 Oct 2006 (sunday) day, if set time is 1:59:00 than after 1 minute it will become 3:00:00 as per DST . This was found to be happening.i.e DST... (1 Reply)
Discussion started by: subratasaharia
1 Replies

6. UNIX for Advanced & Expert Users

Daylight saving not working properly with linux-2.6. kernel

The daylight saving action is not working Time zone was set for that Australia(parth) and issued reboot. Now for DST, (Daylight Saving Time): For 29 Oct 2006 (sunday) day, if set time is 1:59:00 than after 1 minute it will become 3:00:00 as per DST . This was found to be happening.i.e DST... (1 Reply)
Discussion started by: subratasaharia
1 Replies

7. Linux

How to configure daylight saving time

Hi, I have few doubt on daylight saving. Can any one clarify the below points. 1) How to configure daylight saving(DLS) time ? 2) How to query DLS ? 3) If i set DLS(say some how) will it be autometically changed or user has to manually change system time ? I got few info on net about... (3 Replies)
Discussion started by: ashokd001
3 Replies

8. Linux

How does Linux handle DST ( daylight saving time)?

Hello Can sombody please tell me how linux handles DST ( daylight saving time) ? Does the time change instantly , ex: if is is 3'o clock does linux instantly swich to 2'o clock ? plese give more info about this toppic (2 Replies)
Discussion started by: martonlorand
2 Replies

9. Solaris

Solaris 11 Daylight Saving Time

Hello, Quick question: How do I verify if my Solaris 11 hosts/zones, configured with NTP, would change automatically to the DST? Thanks! (1 Reply)
Discussion started by: feroccimx
1 Replies
ctime64(3C)															       ctime64(3C)

NAME
ctime64(), ctime64_r(), difftime64(), gmtime64(), gmtime64_r(), localtime64(), localtime64_r(), mktime64() - convert date and time to string SYNOPSIS
DESCRIPTION
Converts the calendar time pointed to by timer, representing the time in seconds since the Epoch, and return a pointer to the local time in the form of a string. Equivalent to: Is identical to except that it places the result in the user supplied and returns a pointer to upon success. A buffer length of at least 26 is required. Returns the difference in seconds between two calendar times: time1 - time0. Converts directly to Coordinated Universal Time (UTC), the time standard used by the HP-UX operating system. returns a pointer to the structure. Is identical to except that stores the result in the pointed to by and returns upon success. Corrects for the time zone and any summer time zone adjustments (such as Daylight Savings Time in the USA), according to the contents of the environment variable (see below). returns a pointer to the structure. Is identical to except that stores the result in the pointed to by and returns upon success. Converts the broken-down time (expressed as local time) in the structure pointed to by timeptr into a calendar time value with the same encoding as that of the values returned by The original values of the and components of the structure are ignored, and the original values of the other compo- nents are not restricted to the ranges indicated below. A positive or zero value for causes to initially presume that Daylight Saving Time respectively is or is not in effect for the specified time. A negative value for causes to attempt to determine whether Daylight Saving Time is in effect for the specified time. Upon successful completion, all the components are set to represent the specified calendar time, but with their values forced to the ranges indicated below. The final value of is not set until and are determined. returns the specified calendar time encoded as a value of type The behavior of beyond the supported ranges is undefined. The minimum and maximum dates supported by and are Friday December 13 20:45:52 UTC 1901 and Friday December 31 23:59:59 UTC 9999 respec- tively. and returns NULL and sets errno to if timer is less than the number of seconds that corresponds to the minimum date supported (in other words, as defined in or exceeds the number of seconds that corresponds to the maximum date supported. For more details on (see ctime(3C)). EXTERNAL INFLUENCES
Locale The category determines the interpretation of the bytes within format as single and/or multi-byte characters. Environment Variables The function uses the contents of to set the values of the external variables and also determines the time zone name substituted for the and directives and the time zone adjustments performed by and Two methods for specifying a time zone within are described in environ(5). International Code Set Support Single and multibyte character code sets are supported. RETURN VALUE
For if the buffer is of insufficient length, a NULL is returned and errno set to and return a NULL and set errno to if NULL pointers are passed in as arguments. A NULL is returned and errno is set to if the input to the following routines is not within the supported range: and APPLICATION USAGE
The return values for and point to static data whose contents is overwritten by each call. WARNINGS
The range of extends to 61 to allow for the occasional one or two leap seconds. However, the "seconds since the Epoch" value returned by (see time(2)) and passed as the timer argument does not include accumulated leap seconds. The structure generated by and will never reflect any leap seconds. Upon successful completion, forces the value of the component to the range [0,59]. AUTHOR
was developed by HP. SEE ALSO
time(2), ctime(3C), setlocale(3C), tztab(4), environ(5), lang(5), langinfo(5), thread_safety(5). ctime64(3C)
All times are GMT -4. The time now is 01:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy