In 1996 I was 14 years old and was in the third and final year of high school (according to the Mexican schooling program). At that time, always concerned about what would happen next, I began to prepare for the foreseeable future.
I would be lying if I said I am an early bird; quite the opposite, I agree with many of my professional colleagues in being more of a nocturnal person. Taking into account that the first school experience in Mexico (at least in the central part of the country) was simply called «kinder garden» (prelude to elementary school), the school’s starting time was at 9 am. When I started going to elementary school and throughout six years, I had to be in my classroom at 8 am. Later, in high school, the starting time (kept to this day) was at 7 am… and that’s precisely where I was, starting classes at 7 am, preparing to finish high school and, eventually entering preparatory school (the best translation I could make). At that moment, it seemed like I had found the pattern in the starting times (without confirming my hypothesis) -one hour earlier for every higher level-, so I found myself in the complicated situation of starting preparatory school at 6 am, and if everything remained the same, it seemed that in university, the start time would be at 5 am… I can’t describe my suffering.
Later that year, I heard discussions on the radio about «Daylight Saving Time». Countless and incomprehensible (to me) conversations about the topic. However, there was one particular point that was repeated in each conversation, in the voice of one of the interviewers, when he asked his guest:
«So, the idea is that everybody does everything one hour earlier?»
«Yes.»
«So, if I currently wake up at 6, will I have to wake up at 5?»
«Exactly.»

Doing everything an hour earlier? Why? What for?
I was overwhelmed about having to start school at 7 am. If this daylight saving time thing was to be accepted (which seemed likely to happen that same year), then I would be starting classes at 6 am, which obviously meant waking up at some point around 5 am… and that, in addition, would affect the entry times I had calculated in my mind for the further school years… I estimated that at the highest educational level, one would have to wake up at 2 am… it was unbearable for me.
If you’re unfamiliar with the term «Daylight Saving Time,» it refers to the program (adopted by many countries in the 90s) aimed to save electricity by utilizing daylight hours. Interestingly, the name in Mexico, where I live, took the inaccurate name of «summer time» which makes no sense because Daylight saving time began in mid-Spring and ended in mid-Autumn.
From April 1997 to October 2022, this time shift was the norm, where the clock would be set forward one hour in April and set back one hour at the end of October every year. Personally, I didn’t like it. Every time shift, I would have trouble adapting myself, both when moving the clock forward or backward. However, most people in my close circle favored it, arguing that they did perceive more sunlight hours throughout the day.
And what does all this have to do with the chronicles?
Operating systems and programming languages, as they became more complex to incorporate regional settings, such as language, currency formats, time, and date, have included this particularity of daylight saving time in their date and time calculation rules. Computers (servers, PCs), and modern smartphones update automatically when daylight saving time starts and ends (or its equivalent).
Programming languages have also incorporated this feature. For instance, in 2018 we encountered a problem in a system that needed to validate input data and verify that the data had not been generated earlier than 36 hours compared with the current time. There was a complex incident because we received data generated at «2 am» on the day when the time change occurred. The system was built in Java. In principle, on Sunday when the time change takes place, the clock goes from 1:59 am to 3:00 am, without passing through any of the minutes of 2 am. That was the problem, as for Java, considering being in the Mexico City time zone, there was no 2:XX am. Fortunately, we managed to identify the problem and solved it.
Now… in 2022, the Mexican Congress decided not to apply the time change anymore starting in 2023. This means that in April of this year (2023), we did not forward our clocks in Mexico, except in some municipalities part of the border area with the United States. It’s as absurd as leaving home at 10 am, crossing a few kilometers to another municipality (which does not follow Earth’s parallels and/or meridians), and suddenly being required to forward your clock one hour later to 11 am in just a few minutes, because you are now in a zone where the time shift is still applicable (nonsense, I know).
Operating systems without updates are not «aware» of this new setting, therefore the calculation of time and dates remained the same. I have a device with Android 9 that no longer receives updates, and it applied the automatic time change by advancing the hour… you might say, «just set it back manually»… well, I did, but all the date and time calculations are wrong because the device assumed that in Mexico, it should be an hour later, so all calculations were one hour wrong.
The same happened to me with an installation of Java 8/17 and PHP 7.3 I have on my home machine (it is running Windows 10 updated to the last patch and it didn’t forward the clock as expected). For both Java and PHP (not updated), when requesting the current time (after April 2023), the program calculates one hour ahead of what the operating system shows. Please have a look at the following screenshots and compare the calculated time in the program with the time displayed in the Windows taskbar:


To fix this, it is indeed necessary to update the operating system and/or the development and deployment platforms. Sometimes it may seem unnecessary to stay updated, but there are situations where one cannot postpone updates, otherwise, you risk your daily operation.
If you cannot update these components, unfortunately, you will have to implement some routine to adjust the date/time by reversing the effect of daylight saving time by hand. I personally believe (have no proof but the doubt is legitimate) some companies had to do this. Two banks didn’t take down their online services but «coincidentally» they were failing between Sunday and Monday after the time shift.

Deja un comentario