Al parecer esta año 2022, quieren modificar el cambio de hora de un momento a otro. Quiero respaldar una guía que hice el 2011 para hacer el cambio de hora manualmente en Linux, modificando el tzdata. Solo tienen que actualizar los parámetros para este año.
Esta guía es compatible con Redhat/Centos/Fedora o cualquier otra
distribución haciendo las correcciones necesarios. En esta ocasión se
utilizó Centos 5.5.
El archivo o paquete tzdata
contiene todos los horarios y cambios de hora de todas las zonas del mundo
El parche para corregir el primer cambio de hora, que era para el 7 de
Abril, ya está disponible en su versión tzdata2011d y se instala
simplemente utilizando yum, entramos como root del sistema:
yum install tzdata
zdump -v /etc/localtime | grep 2011 /etc/localtime Sun Apr 3 02:59:59 2011 UTC = Sat Apr 2 23:59:59 2011 CLST isdst=1 gmtoff=-10800 /etc/localtime Sun Apr 3 03:00:00 2011 UTC = Sat Apr 2 23:00:00 2011 CLT isdst=0 gmtoff=-14400 /etc/localtime Sun Oct 9 03:59:59 2011 UTC = Sat Oct 8 23:59:59 2011 CLT isdst=0 gmtoff=-14400 /etc/localtime Sun Oct 9 04:00:00 2011 UTC = Sun Oct 9 01:00:00 2011 CLST isdst=1 gmtoff=-10800
zdump -v Chile/Continental | grep 2011 Chile/Continental Sun Apr 3 02:59:59 2011 UTC = Sat Apr 2 23:59:59 2011 CLST isdst=1 gmtoff=-10800 Chile/Continental Sun Apr 3 03:00:00 2011 UTC = Sat Apr 2 23:00:00 2011 CLT isdst=0 gmtoff=-14400 Chile/Continental Sun Oct 9 03:59:59 2011 UTC = Sat Oct 8 23:59:59 2011 CLT isdst=0 gmtoff=-14400 Chile/Continental Sun Oct 9 04:00:00 2011 UTC = Sun Oct 9 01:00:00 2011 CLST isdst=1 gmtoff=-10800
cd /root mkdir tz cd /tz wget ftp://elsie.nci.nih.gov/pub/tzdata2011d.tar.gz
tar zxvf tzdata2011d.tar.gz vi southamerica
Rule Chile 2008 only - Mar 30 3:00u 0 - Rule Chile 2009 only - Mar Sun>=9 3:00u 0 - Rule Chile 2010 2011 - Apr Sun>=1 3:00u 0 - Rule Chile 2012 max - Mar Sun>=9 3:00u 0 -
Rule Chile 2008 only - Mar 30 3:00u 0 - Rule Chile 2009 only - Mar Sun>=9 3:00u 0 - Rule Chile 2010 only - Apr Sun>=1 3:00u 0 - Rule Chile 2011 only - May Sun>=2 3:00u 0 - Rule Chile 2011 only - Aug 21 4:00u 1:00 S Rule Chile 2012 max - Mar Sun>=9 3:00u 0 -
Con esto le decimos al archivo que en el 2011, el primer sabado de Mayo atrase la hora, y que el sabado 20 (domingo 21 a las 00:00) adelante una hora (en realidad que en una fecha somos GTM -3 y en la otra GTM -4).
Para aplicar los cambios, usamos el comando zic (que es una herramienta tzdata):
zic southamerica zic backward
zdump -v Chile/Continental | grep 2011 Chile/Continental Sun May 8 02:59:59 2011 UTC = Sat May 7 23:59:59 2011 CLST isdst=1 gmtoff=-10800 Chile/Continental Sun May 8 03:00:00 2011 UTC = Sat May 7 23:00:00 2011 CLT isdst=0 gmtoff=-14400 Chile/Continental Sun Aug 21 03:59:59 2011 UTC = Sat Aug 20 23:59:59 2011 CLT isdst=0 gmtoff=-14400 Chile/Continental Sun Aug 21 04:00:00 2011 UTC = Sun Aug 21 01:00:00 2011 CLST isdst=1 gmtoff=-10800
Listo? Nooo!! Tenemos que copiar la zona al localtime
cp /usr/share/zoneinfo/Chile/Continental /etc/localtime
zdump -v /etc/localtime | grep 2011 /etc/localtime Sun May 8 02:59:59 2011 UTC = Sat May 7 23:59:59 2011 CLST isdst=1 gmtoff=-10800 /etc/localtime Sun May 8 03:00:00 2011 UTC = Sat May 7 23:00:00 2011 CLT isdst=0 gmtoff=-14400 /etc/localtime Sun Aug 21 03:59:59 2011 UTC = Sat Aug 20 23:59:59 2011 CLT isdst=0 gmtoff=-14400 /etc/localtime Sun Aug 21 04:00:00 2011 UTC = Sun Aug 21 01:00:00 2011 CLST isdst=1 gmtoff=-10800
Lo públique en exclusiva para Chilehardware, hasta que lo suba a mi blog.