This stupid class is backwards:

http://www.boost.org/doc/libs/1_35_0/doc/html/date_time/gregorian.html#date_time.gregorian.date_class

Everyone knows it's dd/mm/yyyy. Except the boost authors it seems.

yyyy/Mmm/dd ?

So annoying I needed a date class to validate dates in format of dd/mm/yyyy from 1970 -> today. Looks like I'll have to write one myself :(
All those functions still take the same constructor though.

date d(2002,Jan,10);

To access and use any of them it means I'd need to split up the strings from file from 01/01/2001 and convert month to Mmm, and reverse it all
----> 2001,Jan,01

edit: and then reverse the proceedure for the output
Last edited on
what?
You'd need to split the strings anyway to use the constructor.
And the reverse takes something like two lines of code.
I don't see why you are having so many problems with this.
BTW http://www.boost.org/doc/libs/1_44_0/doc/html/date_time/date_time_io.html#format_strings
Last edited on
Everyone knows it's dd/mm/yyyy. Except the boost authors it seems.


Locales vary worldwide; this claim is unfounded and ridiculous.
gcampton wrote:
Everyone knows it's dd/mm/yyyy

Except that it isn't, since the ISO date format is yyyy-mm-dd. Today would be 2010-10-08.

yyyy-mm-dd > dd-mm-yyyy > mm-dd-yyyy.
+1 moorecm

In the US, mm/dd/yyyy is more typical.

The confusion is exactly why I avoid using any such numbering system and put text for the month (ex: Oct 8, 2010). That way there's no ambiguities.
I completely agree with that parameter ordering. Anyone who uses little endian or US-endian dates instants in a computing system deserves to be dragged to the back and shot.
Last edited on
I hate to jump on the gcampton-shooting wagon, but why doesn't yyyy-mm-dd makes sense to you? Ignoring the ISO standard, if I were to write a function that took a year, and month, and a day of the month and had default parameters for each, I'd have the year be the most important date (first), month second (second), and the day third (last), as each clamps down on the set of possible dates in order while keeping the elements continuous (the difference between the possible days never increases more than one day).

-Albatross
I can see some value in using numerical yyyy/mm/dd format. It could be sorted lexicographically as a string, for example.
Last edited on
Geez if I can't be random in the Lounge where can I be, on that note:

The ISO standard is bias due to being written by Americans.
YOU: "What's the date today?"
ME: "It's 2010, January the 14th"

I don't think I've ever heard anyone say it like that in English.


YOU: "What's the date today?"
ME: "14th of January" ...... "..... 2010, Have you been in a coma?"
The ISO standard is bias due to being written by Americans.
The ISO standard is unbiased because it's designed so that the string representation can be sorted correctly by a lexicographical compare function: strcmp("2010-05-06","2010-06-05")<0
This isn't by accident; it was designed to meet this requirement (and also because there's no ambiguity as to what endianness the data has).

I don't think I've ever heard anyone say it like that in English.
Human representations are designed to put the most relevant information first. Machine representations are designed to work well with simple algorithms and to prevent ambiguity.
You're not going to argue that we should go back to two-digit year representations, are you?
Topic archived. No new replies allowed.