Sponsored Content
Top Forums UNIX for Dummies Questions & Answers DST did not take effect on 3 Linux servers Post 302299850 by Perderabo on Saturday 21st of March 2009 05:46:28 PM
Old 03-21-2009
There is an internal system clock which is the number of seconds since the epoch and this does not get adjusted for DST. Is is right? Compare the output on a broken and working system of:
perl -e 'print time(), "\n" '

If both systems agree of the second but disagree on the representation, then one must not be patched properly or the systems are set to use different rules. That is controlled by /etc/localtime or maybe the TZ environment variable. Is that the same on both systems? Note that if your systems were up and running during the DST transition, the seconds as returned by that perl command would not suddenly change by one hour. What should change is that a different rule would now come into play about how to display the time in human readable form.

If the seconds on the internal system clock is off, then you need to look at how the system clock is set on both systems. This is the issue that your other source was probably thinking about. At boot time the system clock is initialized from the hardware clock that runs all the time via battery. You can keep in local time if you want, but it must be adjusted for DST. Linux can be set to read it and accept it. This works well when you have two OS's on the same box. Linux assumes the other OS set the clock. But for your hardware clock to cause a problem, you would need to reboot the server so it rereads the hardware clock. Or you would need to to be explicitly reading the hardware clock somehow. If linux is the only os on the box, the hardware clock really should be set to UTC (incorrectly aka GMT).

You could also be using NTP. Are you? If so, very early in the startup scripts you should get the time from an NTP server. Then the time on the hardware clock should irrelevant since it is quickly overwritten. In this case, you have an NTP problem somehow.

Be sure to read: https://www.unix.com/tips-tutorials/3...mekeeping.html

Doesn't redhat have a dateconfig (or maybe date-config) tool? If you have that, compare the settings on both systems. Otherwise check /etc/sysconfig/clock on both systems.
 

10 More Discussions You Might Find Interesting

1. Cybersecurity

Who uses Antivirus software on your linux servers?

So who uses antivirus software on your linux servers? A co-worker and myself have been debating on the need or lack there of for antivirus on a linux webserver running Apache even if that's the only service that may be running. He thinks no and I am of the opinion that it is needed. My rational... (1 Reply)
Discussion started by: jjvaas
1 Replies

2. UNIX for Dummies Questions & Answers

monitering servers in linux

how can i moniter the servers (e.g FTP, NNTP, APACHE) in linux. (4 Replies)
Discussion started by: perleo
4 Replies

3. Gentoo

What do you use on your linux servers?

What do you use on your linux servers? What distributions? (10 Replies)
Discussion started by: DCrystal
10 Replies

4. What is on Your Mind?

Microsoft servers Vs. Unix/Linux

What you have to say about the following comparison: Compare (2 Replies)
Discussion started by: tayyabq8
2 Replies

5. UNIX for Dummies Questions & Answers

Fax Servers for Linux/AIX

At the company where I work, use a product called VSI-FAX. It works nicely, but the maintenance has proven to be very poor grade. So, I'm interested in any experiences using other fax servers that run on Linux or AIX and what issues/gotchas were run into and overcome and how. I'm considering... (0 Replies)
Discussion started by: kpearson
0 Replies

6. Linux

Few Questions on about Linux Servers.

1.On x86 Machines ( Pentium4 ), What is the maximum number of Services( sshd, ntpd,named ,samba, etc.) that can be installed.? Is there a rule of thumb to attain the best possible performence.? 2. Is there a systematic way to boot a remote Machine.? 3. Are there any problems of having two... (2 Replies)
Discussion started by: kanata
2 Replies

7. UNIX for Dummies Questions & Answers

SSH into multiple linux servers

Hi All, Okay, I need help. I need to ssh in to multiple linux servers execute certain commands and get them to email and print on the screen when the script is being executed. So below is my script. Its not working :-(. #!/bin/bash #linux/UNIX box with ssh key based login... (7 Replies)
Discussion started by: xytiz
7 Replies

8. Linux

How to check CFG2HTML for Linux servers?

Hi, Could someone please let me know how to How to check CFG2HTML for Linux servers? I am new for OS end. Thanks, Vivek. (4 Replies)
Discussion started by: Viv_kadam
4 Replies

9. Shell Programming and Scripting

Script to locating Linux servers

All, Need an urgent help! , I have an simple text file that holding more than 500 IP Address, My requirement : bash script that will run from my central server , and will scan with nmap all the 500 ip address , for ssh port with . for example with the command : nmap -sT | grep '22.*open' ... (1 Reply)
Discussion started by: James Stone
1 Replies

10. 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
DateTime::TimeZone::SystemV(3pm)			User Contributed Perl Documentation			  DateTime::TimeZone::SystemV(3pm)

NAME
DateTime::TimeZone::SystemV - System V and POSIX timezone strings SYNOPSIS
use DateTime::TimeZone::SystemV; $tz = DateTime::TimeZone::SystemV->new("EST5EDT"); if($tz->is_floating) { ... if($tz->is_utc) { ... if($tz->is_olson) { ... $category = $tz->category; $tz_string = $tz->name; if($tz->has_dst_changes) { ... if($tz->is_dst_for_datetime($dt)) { ... $offset = $tz->offset_for_datetime($dt); $abbrev = $tz->short_name_for_datetime($dt); $offset = $tz->offset_for_local_datetime($dt); DESCRIPTION
An instance of this class represents a timezone that was specified by means of a System V timezone string or the POSIX extended form of the same syntax. These can express a plain offset from Universal Time, or a system of two offsets (standard and daylight saving time) switching on a yearly cycle according to certain types of rule. This class implements the DateTime::TimeZone interface, so that its instances can be used with DateTime objects. SYSTEM V TIMEZONE SYNTAX
In the POSIX extended form of the System V timezone syntax, a timezone may be specified that has a fixed offset by the syntax "aaaooo", or a timezone with DST by the syntax "aaaoooaaa[ooo],rrr,rrr". "aaa" gives an abbreviation by which an offset is known, "ooo" specifies the offset, and "rrr" is a rule for when DST starts or ends. For backward compatibility, the rules part may also be omitted from a DST-using timezone, in which case some built-in default rules are used; don't rely on those rules being useful. An abbreviation must be a string of three or more characters from ASCII alphanumerics, "+", and "-". If it contains only ASCII alphabetic characters then the abbreviation specification "aaa" may be simply the abbreviation. Otherwise "aaa" must consist of the abbreviation wrapped in angle brackets ("<...>"). The angle bracket form is always allowed. An offset (from Universal Time), "ooo", is given in hours, or hours and minutes, or hours and minutes and seconds, with an optional preceding sign. The maximum magnitude permitted is 24:59:59. The sign in the specification is the opposite of the sign of the actual offset. If no sign is given then the default is "+", meaning a timezone that is behind UT. If no DST offset is specified, it defaults to one hour ahead of the standard offset. A DST-using timezone has one change to DST and one change to standard time in each Gregorian year. The changes may be in either order within the year. If the changes are in different orders from year to year then the behaviour is undefined; don't rely on it remaining the same in future versions. A change rule "rrr" takes the form "ddd[/ttt]", where "ddd" is the rule giving the day on which the change takes place and "ttt" is the time of day at which the change takes place. The time may be given in hours, or hours and minutes, or hours and minutes and seconds, and if not stated then it defaults to 02:00:00. The time for the change to DST is interpreted according to the standard offset, and the time for the change to standard time is interpreted according to the DST offset. (Thus normally the change time is interpreted according to the offset that prevailed immediately before the change.) A day rule "ddd" may take three forms. Firstly, "Jnnn" means the month-day date that is the nnnth day of a non-leap year. Thus "J59" means the February 28 and "J60" means March 1 (even in a leap year). February 29 cannot be specified this way. Secondly, if "ddd" is just a decimal number, it means the (1+ddd)th day of the year. February 29 counts in this case, and it is not possible to specify December 31 of a leap year. Thirdly, "ddd" may have the form "Mm.w.d" means day d of the wth week of the mth month. The day is given as a single digit, with "0" meaning Sunday and "6" meaning Saturday. The first week contains days 1 to 7 of the month, the second week contains days 8 to 14, and so on. If "w" is "5" then the last week of the month (containing its last seven days) is used, rather than the fifth week (which is incomplete). Examples: MUT-4 Mauritius time, since 1907: 4 hours ahead of UT all year. EST5EDT,M3.2.0,M11.1.0 US Eastern timezone with DST, from 2007 onwards. 5 hours behind UT in winter and 4 hours behind in summer. Changes on the second Sunday in March and the first Sunday in November, in each case at 02:00 local time. NST3:30NDT,M3.2.0/0:01,M11.1.0/0:01 Newfoundland timezone with DST, from 2007 onwards. 3.5 hours behind UT in winter and 2.5 hours behind in summer. Changes on the second Sunday in March and the first Sunday in November, in each case at 00:01 local time. GMT0BST,M3.5.0/1,M10.5.0 UK civil time, from 1996 onwards. On UT during the winter, calling it "GMT", and 1 hour ahead of UT during the summer, called "BST". Changes on the last Sunday in March and the last Sunday in October, in each case at 01:00 UT. EST-10EST,M10.5.0,M3.5.0/3 Australian Eastern timezone, from 2007 onwards. 10 hours ahead of UT in the southern winter (the middle of the calendar year), and 11 hours ahead in the southern summer. Changes to DST on the last Sunday in October, and back on the last Sunday in March, in each case at 02:00 standard time (16:00 UT of the preceding day). CONSTRUCTOR
DateTime::TimeZone::SystemV->new(TZ_STRING) TZ_STRING must be a timezone specification as described in "SYSTEM V TIMEZONE SYNTAX". Constructs and returns a DateTime-compatible timezone object that implements the timezone specified by TZ_STRING. METHODS
These methods are all part of the DateTime::TimeZone interface. See that class for the general meaning of these methods; the documentation below only comments on the specific behaviour of this class. Identification $tz->is_floating Returns false. $tz->is_utc Returns false. $tz->is_olson Returns false. $tz->category Returns "undef", because the category concept doesn't properly apply to these timezones. $tz->name Returns the TZ_STRING that was supplied to the constructor. Offsets $tz->has_dst_changes Returns a boolean indicating whether the timezone includes a DST offset. $tz->is_dst_for_datetime(DT) DT must be a DateTime-compatible object (specifically, it must implement the "utc_rd_values" method). Returns a boolean indicating whether the timezone is on DST at the instant represented by DT. $tz->offset_for_datetime(DT) DT must be a DateTime-compatible object (specifically, it must implement the "utc_rd_values" method). Returns the offset from UT that is in effect at the instant represented by DT, in seconds. $tz->short_name_for_datetime(DT) DT must be a DateTime-compatible object (specifically, it must implement the "utc_rd_values" method). Returns the time scale abbreviation for the offset that is in effect at the instant represented by DT. $tz->offset_for_local_datetime(DT) DT must be a DateTime-compatible object (specifically, it must implement the "local_rd_values" method). Takes the local time represented by DT (regardless of what absolute time it also represents), and interprets that as a local time in the timezone of the timezone object (not the timezone used in DT). Returns the offset from UT that is in effect at that local time, in seconds. If the local time given is ambiguous due to a nearby offset change, the numerically lower offset (usually the standard one) is returned with no warning of the situation. If the local time given does not exist due to a nearby offset change, the method "die"s saying so. SEE ALSO
DateTime, DateTime::TimeZone AUTHOR
Andrew Main (Zefram) <zefram@fysh.org> COPYRIGHT
Copyright (C) 2007, 2009 Andrew Main (Zefram) <zefram@fysh.org> LICENSE
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.10.1 2010-03-30 DateTime::TimeZone::SystemV(3pm)
All times are GMT -4. The time now is 06:46 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy