How does Linux handle DST ( daylight saving time)?


 
Thread Tools Search this Thread
Operating Systems Linux How does Linux handle DST ( daylight saving time)?
# 1  
Old 10-22-2014
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  
Old 10-22-2014
No. Linux uses epoch time - the number of seconds since Jan 1, 1970. Look at the very top right of the pages here on UNIX.com. Look for UNIX time. Currently it is 1413986703 seconds.

There is something called the C runtime library - all of the commands in UNIX use that library. Because people use differing locale settings (alphabetic characters, names for months, different ways od doing daylight savings times etc.) the guys who put this together decided to use some library calls to change the UNIX epoch seconds into human readable time, including changes from standard to daylight time.

ctime() and strftime() are part of that library. The date command uses the library and provides a command line interface for times and dates.

So if you are in a country with no daylight/standard time change, then date knows about it through your locale and timezone settings.
Type
Code:
echo "TZ is $TZ, locale is `locale`"

at the command line to see your settings.
# 3  
Old 10-22-2014
Not always -- it can be globally set with a file, too, /etc/localtime, which you copy from a selection in /usr/share/localtime. I copied /usr/share/zoneinfo/Canada/Saskatchewan for instance. This gives my system a timezone without having a value set for TZ.

TZ is often used to override the global setting to operate in multiple regions... and sometimes for crude date math (subtracting a number of hours), etc.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

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

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

3. UNIX for Advanced & Expert Users

Handle Autosys with DST Changes

Hi, I have one confusion regarding DST chnages which are going to happen after October. :confused: :confused: I have few jobs on Autosys which run as per Japan Time. they shoudl not be affected by switiching off of DST time. Our autosys instance server is based on UK which is running on... (0 Replies)
Discussion started by: girdharsourabh
0 Replies

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

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

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

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

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

9. 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
Login or Register to Ask a Question