- Feature Articles
- CodeSOD
- Error'd
-
Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
I am glad he did not work on time zones https://www.youtube.com/watch?v=-5wpm-gesOY
Admin
This looks to me like the developer experimenting after finding out the hard way that the conversion is lossy.
Admin
Dates (and time) are not the biggest problem facing mankind today, what with multiple wars and horrendous oppression around the world. But, if we were to entertain the idea of a perfect date system, what would it be? 13 months of 28 days each, 12 months in a 4-4-5 week pattern (28-28-35 days), or something else?
What about time, should it be 10 hours, 100 minutes and 100 seconds, like the French want? Or 20 hours, 50 minutes or 100 seconds?
Admin
What's the great, big advantage of just a different notation for dates? That it looks neater to someone with OCD? The Gregorian calendar (partially) solved an inherent time keeping problem, that is going to trouble any formatting system.
Admin
Pope Gregory only had to skip 10 days. That's the discontinuity you mention below. It became progressively more in other countries the later they made the switch.
Admin
This is exactly what I came to the comments page to post.
Admin
The problem is that whatever we adopt, it needs to be projectable in a consistent fashion to historical dates. But historical dates are a mess and a trainwreck.
But clearly, the right answer is Stardates.
Admin
Give me time(2) or give me death!
Admin
Leaving aside that dates have never been the biggest problem for anyone outside some software developers and a handful of historians, the perfect system already exists: time units ellapsed since a point in time. It doesn't matter if you use milliseconds since 1970 or 100ns since year 1, both are fine and the same. The issue is and always will be us trying to circumvent our limitations and in the process rendering all systems imperfect. In the end the best system we can use is just the one we're already used to because that's the easiest one to remember.
Admin
Yes. The clue is in the text:
and
Ten days difference, not 13. I'd say it is an off by one error, but that would be an off by two error.
When the UK finally adopted the Gregorian calendar 1752-09-02 was succeeded by 1752-09-14 - eleven days. I vaguely remember reading (in my youth) that there were riots because people thought those days had literally been removed.
Addendum 2025-09-30 10:53: Disappointingly, Wikipedia says the riots are a myth. Booo.
Admin
Since a solar year isn't a whole number of days, you're always going to have a periodic adjustment of some kind. 13 months of 28 days would also be short a whole day every year, so you'd have to make that up somehow.
One option is the lunar calendar worked out about 1500 years ago, when people that could do math figured out that 19 solar years is very close to a whole number of revolutions of the moon. Every 19 years, 12 of the years have 12 months and the other 7 have 13 months.
Admin
AGlezB nailed it. Ticks of arbitrary size since arbitrary epoch FTW!
Mapping that clarity into the swirling confusion and laziness of ongoing human affairs is left as an an exercise for the social sciences.
Heck, mapping that clarity into the incommensurable units of slowly changing eccentric orbits and slowly changing rotations is itself a mess.
Similar to how SI is a nice neat set of cohesive units that most of the world's populace bastardizes in one way or another in their daily use.
Admin
A friend of mine proposed 12 months of 28 days with a week separating every 3 months for handling end-of-quarter business. that takes you to 364 days. Add a new-years day and every leap year either extended new year's day to a second day or pop it in half a year later. I can see benefits to that calendar, but it would mean too much social upheaval.
This brings up a favorite trivia question: In what moth did the October Revolution occur?¹ Answer: November. Russia was still on the Julian calendar when the revolution started.
¹ C.f, "The Hunt for the Red October"
Admin
Whenever I see
GregorianCalendar
in Java code, I scream. It is a reminder of how terrible date/time handling in Java was until Java 8 finally did it right. (Yes, there was joda-time, but it was an external library.)Admin
Can you provide a source for this remarkable assertion? (i.e. that the contemporary French want such a piece of lunacy)(1)
That said, perhaps 1000 .beats per day might be better?
(1) OK, sure, in the past, there was a movement to promote such a ... revolutionary ... (sorry) thing, but I see no sign of it among the French people that I see every day.
Admin
Unlikely, the November moth (Epirrita dilutata) is not all that big, although it can be found in Russia.
Admin
Yes, stardates, the only system that would never cause any debate: https://en.wikipedia.org/wiki/Talk:Stardate
Admin
And I propose that instead of using an arbitrary deity's arbitrary birth date as the arbitrary epoch, we go back to how they did it in medieval times and use an arbitrary ruler's (no, not the measuring stick) arbitrary date of ascension to rule as the arbitrary epoch. For example we are currently in the Epoch of the Narcissistic Orange Sociopath.
Admin
I assume that's a reference to https://en.wikipedia.org/wiki/Decimal_time . The French Republic calendar from 1794–1800 tried to introduce a decimalized time of day, but unsurprisingly it didn't catch on. I don't think the modern French care for this at all.
Admin
Also, the soviet calendar with its 5 (or 6) days per week - https://en.wikipedia.org/wiki/Soviet_calendar
Admin
For those with insomnia or the unrestrained need to know, the book “Calendrical Calculations” by Dershowitz & Reingold will definitely scratch that itch.
Admin
"time units elapse since a point in time" which you will always get wrong unless you are meticulous about tracking all the leap seconds added or removed since that starting point.
Admin
Tracking seconds since epoch is simple with atomic clocks. The difficult part is mapping them to spans of time that are often more relevant for humans: minutes, hours, days, and years since none of those have a fixed length of seconds due to leap seconds and days, as you mention.
Admin
Not only software developers. Also accountants, and holidays are annoying - "what day is Christmas this year", etc.
I'm also annoyed by "fiscal years" that some governments run on - those have to go - just run your fiscal stuff by calendar year, stop being difficult.
I know, this isn't happening, definitely not anytime in our lives, but still, it's an interesting thought experiment.
Admin
Perhaps it's a good indication to actually stay away from such changes, given who else in history tried moving in that direction, hahaha
Admin
I propose a different epoch: counting time since the last irrelevant bringing-up of Trump in a context where no o e so much as hinted to any desire for such. The year in that system, then, will be a very socialistic Year Zero.
Admin
Leap time units are a human mechanism made to fit variable time frames (rotation and translation of the planet) into the actual ellapsed time. And even our definition of a second is arbitrary because we started from a variable time frame (day) and divided it by 24 hours and 60 minutes and 60 seconds so we ended with the time it takes a Cs-133 atom to vibrate 9,192,631,770 times instead of something more reasonable like 10^10. Every time this topic comes out I can't help remembering Washington's Dream SNL sketch when Nate Bargatze says "5280, of course. It's a simple number that everyone will remember."
Admin
TRWTF is using a link to Java 8 when 4 LTS versions have been released since (11, 17, 21 and 25). Here's the same link for Java 25: https://docs.oracle.com/en/java/javase/25/docs/api/java.xml/javax/xml/datatype/DatatypeFactory.html#newXMLGregorianCalendar(java.util.GregorianCalendar)
Admin
It's crazy how much commercial software is still Java 8 only (curious whether we will see the same with .NET 4 - for now yes).
And it is even more crazy how flexible dates in XML are (what components are optional), which is the entire reason why XmlGregorianCalendar was invented (so you can null out any of the fields and serialize to XML and back).
For example, who needs a date that has no hour and minute, but a time zone?
Admin
Question: In what month does the Oktoberfest occur? Answer: In September. (Since 1872 because of the weather.)
Admin
And he completely skipped over the Japanese Imperial calendar https://en.wikipedia.org/wiki/Japanese_imperial_year
Admin
I suggest we attach a couple of giant rockets to earth, and use them to move it to a slightly lower orbit so orbits at exactly 360 days, and also make it spin slightly faster to get exactly 24 hour days. That should fix up the calendar nicely.
Admin
This is how the Japanese coins are dated (still today, as far as I know). Except in the first year of the era, that is "元" instead of "一" or "1" or "first"...
Admin
It never ends with some of you. This is not a political forum. This just simply doesn't belong here.
Admin
Sounds to me like the whole point of this is to include "if (false)" blocks in the code that bypass the static analysis and avoid getting flagged as dead code
Admin
the extra day is relatively easy (nothing in dates is easy) you have it as its own special day such a newyears day. & then start jan 01 as a Monday again.
Admin
We kinda have that already, it's the Julian Day calendar. Astronomers love it, and IIRC it's Ruby internal system.
Admin
One could question the weird way some countries (mostly Northern Hemisphere ones from what I can tell) do their seasons.
In what universe does it make sense to start and end a season mid-month!?
At least here in Australia, we perfected it by saying that a season starts on the 1st day of a month and ends on the last day of a month, means seasons are always a known thing.
And financial year is 01/07 to 30/06, easy to remember :P
Admin
One could question the weird way some countries (mostly Northern Hemisphere ones from what I can tell) do their seasons.
In what universe does it make sense to start and end a season mid-month!?
At least here in Australia, we perfected it by saying that a season starts on the 1st day of a month and ends on the last day of a month, means seasons are always a known thing.
And financial year is 01/07 to 30/06, easy to remember :P
Admin
Any calendarised start to a season is going to be pretty arbitrary, and the European convention of solstices and equinoxes (equinoces?) is just as known/definable as the modern-Australian convention of 1st of month. The correlation of either with local conditions is loose at best. The indigenous Australian seasonal calendars vary even in the number of seasons (I've seen examples ranging from 3 to 6), reflecting the significant differences in climate. Maybe it'll be easier when the whole planet just has two seasons, summer and other summer.
Yes, our Australian financial year is 01/07 to 30/06 (July to June for any confused American readers) - except when it isn't. I've been part of organisations where the financial year is January to December or even October to September. For that matter, our income tax year is July-June but our fringe benefits tax year is April-March, which is a WTF in itself.
Admin
As far as I've been able to tell, there isn't any country or standards body in the world that has provided a definition of when seasons begin and end.
Two widely used international definitions are the astronomical definition, where seasons begin on the solstices and equinoxes, and the meteorological definition, where they begin on the first day of January, April, July, and October. But there are plenty of other definitions in use as well.
Admin
This was interesting to me - so I checked it. the issue is not that it's lossy. The issue is that the XMLGregorianCalendar keeps the timezone as offset in minutes. When converting back from the XMLGregorianCalendar to the GregorianCalendar, you'll see these timezone IDs.
GregorianCalendar [America/New_York] XMLGregorianCalendar [GMT-04:00]
if you initialize the GregorianCalendar with a TZ offset that will match - a GMT offset instead of the TZ name:
GregorianCalendar result = new java.util.GregorianCalendar(TimeZone.getTimeZone("GMT-04:00") , Locale.getDefault());
then gregorianCalendar.equals(xmlVersion.toGregorianCalendar()) is true