4 ms·
Honestly at this point if you are not storing dates in UTC form and transforming it in order to get to the Japanese calendar format, you are doing things wrong.
by Iv 8y ago
Honestly at this point if you are not storing dates in UTC form and transforming it in order to get to the Japanese calendar format, you are doing things wrong. The emperor is not eternal (yeah, I know, blasphemy) and the end of the era is totally expected.
- KMag 8y agoWhat does it mean to store a date in a time zone (such as UTC) form? Do you mean store dates as timestamps of UTC midnight on that date? Even this isn't a storage format: do you mean a big-endian Java epoch milliseconds timestamp, ISO 8601 text, or some other format? I think you mean they should be using some representation of a Gregorian calendar date, be it text or binary. In any case, it sounds like they should probably have something analogous to the timezone database for converting between various calendars where the mapping can't be determined in advance. That brings up a good question: in the Islamic calendar, the new year doesn't start until reception of a reliable lunar observation by a Muslim. How do they get around this in strict Muslim countries? Do they have a second concept for "year" that's identical to the year except in the observational requirement and therefore can be treated the same, but because of name doesn't break the religious law? I presume they don't go through the trouble of creating a low-latency network to distribute the start-of-year signal and make timestamp-to-string routines block near the year rollover until they've seen the signal.
- Iv 8y agoWell look at how DST regulation changes (about one worldwide every six months) are handled: tzdata is the most underrated project around. I would not be surprised if islami calendars relied on something similar. In their case it is easier as there are (to my knowledge) not several islamic zones observing different rules. https://en.wikipedia.org/wiki/Tz_database https://en.wikipedia.org/wiki/Tz_database
- KMag 8y agoYes, that's the Wikipedia link to the timezone database I mentioned. But, latency is the issue. The year doesn't officially change until a Muslim makes the necessary lunar observation on the first evening of the new year. You can't pre-calculate a human observation, so to be in strict compliance, you'd need an efficient way to rapidly distribute the observation. I'm sure that in practice, pre-calculation is almost always used. My question is how this is rationalized in more strict conservative Islamic countries, (or less likely, how they avoid using pre-calculated start of the new year).
- bloak 8y agoI would guess that the people tasked with observing the new moon have a sense of responsibility and know on which day they are expected to observe it, so they do the right thing. It's easy enough to avoid observing the new moon too early: just don't look at the sunset on the day before. Making sure you do observe the new moon on the right day is harder, but if you have several observatories you can probably manage it without self-deception almost every time.