Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Timestamp - confusion with daylight saving time Post 71746 by Perderabo on Saturday 14th of May 2005 09:31:20 AM
Old 05-14-2005
Quote:
Originally Posted by softmachine
in autumn the unix-timestamp follows further its continuous mode and the real time as well: i.e. that the time does not step back again one hour.
Excuse me?

Code:
$ cat timetool.c
#include <stdlib.h>
#include <time.h>

main(argc,argv)
char **argv;
{
        long start, now;
        char buff[100];
        struct tm *tm;
        start=atoi(argv[1]);
        for(now=start; now < (start + 18 * 600); now+=600) {
                tm=localtime(&now);
                strftime(buff,100, "%A  %b %e, %Y  %H:%M %Z", tm);
                printf(" %13d   =  %s \n", now, buff);
        }

}
$ ./timetool 1130647000
    1130647000   =  Sunday  Oct 30, 2005  00:36 EDT
    1130647600   =  Sunday  Oct 30, 2005  00:46 EDT
    1130648200   =  Sunday  Oct 30, 2005  00:56 EDT
    1130648800   =  Sunday  Oct 30, 2005  01:06 EDT
    1130649400   =  Sunday  Oct 30, 2005  01:16 EDT
    1130650000   =  Sunday  Oct 30, 2005  01:26 EDT
    1130650600   =  Sunday  Oct 30, 2005  01:36 EDT
    1130651200   =  Sunday  Oct 30, 2005  01:46 EDT
    1130651800   =  Sunday  Oct 30, 2005  01:56 EDT
    1130652400   =  Sunday  Oct 30, 2005  01:06 EST
    1130653000   =  Sunday  Oct 30, 2005  01:16 EST
    1130653600   =  Sunday  Oct 30, 2005  01:26 EST
    1130654200   =  Sunday  Oct 30, 2005  01:36 EST
    1130654800   =  Sunday  Oct 30, 2005  01:46 EST
    1130655400   =  Sunday  Oct 30, 2005  01:56 EST
    1130656000   =  Sunday  Oct 30, 2005  02:06 EST
    1130656600   =  Sunday  Oct 30, 2005  02:16 EST
    1130657200   =  Sunday  Oct 30, 2005  02:26 EST
$

 

9 More Discussions You Might Find Interesting

1. 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

2. 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

3. AIX

Implement daylight saving.

Hi all We are currently using AIX 5.3, we reuquire to change the time according to the daylight saving scenario. We are using the internal clock and are not synced with ntp server. Can any one please tell me how to do that without effecting the processes running on the servers? (1 Reply)
Discussion started by: masquerer
1 Replies

4. Ubuntu

How can I find my current Daylight Saving offset?

Hello all, I'm having a problem where a script needs to calculate GMT time given local time. For 6 months, that's easy. The other 6 months, it's not, as I have to add an extra hour to allow for Daylight Saving. At the moment, I manually add and remove an offset but, for obvious reasons, I'd... (2 Replies)
Discussion started by: alexandicity
2 Replies

5. 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

6. Linux

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... (4 Replies)
Discussion started by: suryaemlinux
4 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
All times are GMT -4. The time now is 04:50 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy