News for hackers. Stuff that matters.
Re:Idea for date formatting strings by theli0nheart on Tuesday July 13, 2010 @04:03PM (#1512537)
Great in theory, but in practice it would be really tough to implement. A lot of assumptions would be made. For example, what should "01-01-01" be interpreted as?

Also, date format strings are pretty standard. If you ever forget them, just type `man strftime` at the command line.

Re:Idea for date formatting strings by powrtoch on Tuesday July 13, 2010 @04:43PM (#1512683)
Precisely. Ultimately, no one is going to use a language where there's no way to output a date in a form that will be sometimes ambiguous. And how often do you really even find yourself printing totally unambiguous time stamps? For my part it's way more likely that I'll output "2-11-2009" than "Monday, January 1st 2004 10:43 EST".
Re:Idea for date formatting strings by jacabado on Tuesday July 13, 2010 @05:16PM (#1512786)
Ambiguous example formatting strings would give an error, as an invalid one does now. I like the proposal, although localization is an issue as the examples would have to be in a concrete language.

Removing unneeded abstractions is positive, specially if you have to deal with conflicting models.

Re:Idea for date formatting strings by galdosd on Tuesday July 13, 2010 @05:12PM (#1512777)
Why would 01-01-01 be a problem? If you're writing a format string in this "format string by example" scheme, you don't have to be able to express every possible date-time in it, just a single chosen one.

Or perhaps force the choice of a particular (memorable) date-time, such as January 2nd, 2000, 3:04 am and 5 seconds?

Re:Idea for date formatting strings by InclinedPlane on Tuesday July 13, 2010 @05:41PM (#1512865)
You're letting perfect be the enemy of the good.

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.

Re:Idea for date formatting strings by CoryMathews on Tuesday July 13, 2010 @04:12PM (#1512561)
and when I forget "man strftime"?
Re:Idea for date formatting strings by d0m on Tuesday July 13, 2010 @04:36PM (#1512647)
google date formating (and please, no "if I forget google")