Idea for date formatting strings
notes.torrez.org
notes.torrez.org
date_for('de_CH', SHORT, some_date_value)
and be done with it. In Switzerland alone, we have three ways (or four, depending on who you ask) to specify and format a date. Heck, we can't even agree whether the decimal point of numbers should be a period (de_CH) or a comma (fr_CH)Also, date format strings are pretty standard. If you ever forget them, just type `man strftime` at the command line.
Removing unneeded abstractions is positive, specially if you have to deal with conflicting models.
Or perhaps force the choice of a particular (memorable) date-time, such as January 2nd, 2000, 3:04 am and 5 seconds?
If you can't unambiguously determine the format from the example, kick it back to the user and ask for a better example. Easy peasy. As it turns out, users are incentivized to give good examples because they want to get work done. They won't provide "01-01-01" as an example unless they want to waste their own time.
Pick some date that is perfectly suitable to using in an example formatted date such that the format can be inferred from the example (for all reasonable formats). I propose: 1:23:45pm, Friday, December 31st, 1999, which has the advantage of making it easy to determine whether am/pm should be used or 24h time.
Here's a demo with source (PHP):
Simple example:
10 Jan 2010 //parser determines that "10" is ambiguous, reads Jan as "month" and "2010" as year. So "10" is day of the month.
Now consider the same date but written as "dd-MMM-yy" format:
10-Jan-10 //Good luck!