πŸ“œ ⬆️ ⬇️

Moving of MSD time zone to MSK - new local scale Y2K

Everyone has probably heard at least once that in Russia from 2011 the transition from summer to winter time has been canceled. How does this threaten each of us - and administrators of a large number of servers in complex systems, and ordinary users who have the same computer and mobile phone? What happens on the night of October 29-30, 2011 - to which, by the way, only 2 weeks are left?

New Federal Law of the Russian Federation of June 3, 2011 N 107- β€œOn the calculation of time” :
What threatens us with these changes and what can break from it?

What exactly and when changes?


Europe/Moscow : MSD = UTC+4 MSK = UTC+3. timezone , MSK UTC+4. , , , «» β€” .. Europe/Moscow.

UNIX timestamp β€” , , 1970-01-01 00:00:00 UTC. .

Timestamp
0Jan  1 03:00:00 MSK 1970Jan  1 03:00:00 MSK 1970
20111296000000Jan 26 03:00:00 MSK 2011Jan 26 03:00:00 MSK 2011
20111310000000Jul  7 04:53:20 MSD 2011Jul  7 04:53:20 MSK 2011
20111325000000Dec 27 18:33:20 MSK 2011Dec 27 19:33:20 MSK 2011
1319929199Oct 30 02:59:59 MSD 2011Oct 30 02:59:59 MSK 2011
1319929200Oct 30 02:00:00 MSK 2011Oct 30 03:00:00 MSK 2011

, , Y2k 1319929199 1319929200- β€” , .


(.. , ) TZ database, elsie.nci.nih.gov/pub

: 4 β€” , β€” .

TZ database : 2011-06-06, 2011h 2011-06-15.

, : tzdata , 2011h (.. 2011i, 2011j ..) β€” .

timezone?


, .

, , timezone Europe/Moscow β€” , -- UTC β€” .

:

ntp-, β€” , ?


, : ntp- UNIX timestamp, , , . , β€” , ntp- , , , : ntp, Β« Β» ntp «» . «» timezone.

- UTC, β€” GMT?


, : UTC (Universal Time, Coordinated) (~ 1960-) β€” , , , .

β€” GMT UTC β€” GMT «» . GMT UTC ~0.9 . , 50 , Β« Β» GMT.

, - ?


, , , .


, β€” , , : 2011-10-30 01:59 1 1 . / 02:00 β€” , , , timezone . 03:00 β€” , .

Linux


Linux timezones, /usr/share/zoneinfo. β€” , , :
ALT Linux Platform 6tzdata2011h2011-07-01
Arch Linuxtzdata2011h-1<2011-07-08
CentOS/RHEL 4tzdata2011h-2.el42011-08-29
CentOS/RHEL 5tzdata2011h-1.el52011-06-28
Debian stable (squeeze)tzdata2011h-0squeeze12011-08-13
openSUSE 11.4timezone2011i-2.2.12011-09-04
Ubuntu hardytzdata2011j~repack-0ubuntu0.8.042011-09-16
Ubuntu lucidtzdata2011j-0ubuntu0.10.042011-09-16
Ubuntu nattytzdata2011j-0ubuntu0.11.042011-09-15

: :
#!/bin/sh -ef
S1=$(LC_ALL=C TZ=Europe/Moscow date -d @1314567890)
[ "$S1" = 'Mon Aug 29 01:44:50 MSK 2011' ] || (echo FAIL1; exit 1)
S2=$(LC_ALL=C TZ=Europe/Moscow date -d @1324567890)
[ "$S2" = 'Thu Dec 22 19:31:30 MSK 2011' ] || (echo FAIL2; exit 2)
echo OK

-, OK exit status β€” . : , , - - - timezones ; β€” , - .

FreeBSD


head stable FreeBSD 8 2011-06-28.

: - , :
#!/bin/sh -ef
S1=$(LC_ALL=C TZ=Europe/Moscow date -r 1314567890)
[ "$S1" = 'Mon Aug 29 01:44:50 MSK 2011' ] || (echo FAIL1; exit 1)
S2=$(LC_ALL=C TZ=Europe/Moscow date -r 1324567890)
[ "$S2" = 'Thu Dec 22 19:31:30 MSK 2011' ] || (echo FAIL2; exit 2)
echo OK

Mac OS X. , - , .

Solaris


Timezone 2011h :
, , patchadd, , tzreload.

7055084.

Windows


Windows 2011 β€” 2570791 ( pokryshkin). . :
.

, 914387.
( ComputerPers)

Windows- Β« , , Β» roman_tik.

Java


Java, , timezones - $JAVA_HOME/lib/zi β€” ( ) .

«» Oracle Java SE 2011h, 1.3.40, 2011-06-29.

: TestMSD.java :
import java.util.*;
import java.text.DateFormat;

public class TestMSD {
    public static void main(String[] args) {
        Calendar c = Calendar.getInstance(TimeZone.getTimeZone("Europe/Moscow"));
        DateFormat df = DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL, Locale.US);
        df.setCalendar(c);

        c.setTimeInMillis(1314567890L * 1000L);
        if (!df.format(c.getTime()).equals("Monday, August 29, 2011 1:44:50 AM MSK")) {
            System.out.println("FAIL1");
            System.exit(1);
        }

        c.setTimeInMillis(1324567890L * 1000L);
        if (!df.format(c.getTime()).equals("Thursday, December 22, 2011 7:31:30 PM MSK")) {
            System.out.println("FAIL2");
            System.exit(2);
        }

        System.out.println("OK");
        System.exit(0);
    }
}

javac TestMSD.java, java TestMSD. β€” OK stdout exit status = 0, .

Android


Android- /etc/timezones.db, java- java. /usr/share/zoneinfo .

, , , :

: 2011-2012 , «Moscow Standard Time» ; «» :


Maemo


Maemo , GNU/Linux β€” .. /usr/share/zoneinfo, tzdata .. ( wholeman):
: busybox' date -d 12221931.30 +%s 1324567890.

Symbian


, , .. - «» :
: Android, Β« β†’ β†’ Β», - 2011 , Β«GMT +3.00 Β»:

β€” , .



, , , : , ( ), , β€” , , : Windows, Mac OS X / Classic, / Symbian, Android, iOS, MeeGo, Windows Mobile/Phone 7, Nabaztag, Playstation/XBox, Perl, PHP, Ruby, Python, SQL- ..

')

Source: https://habr.com/ru/post/130363/


All Articles