Hacker News new | past | comments | ask | show | jobs | submit login

I had also this response: nonsense mixtures of conversions could be diagnosed by the compiler or possibly at run-time.

Example:

  foo.c:123:warning: strftime week-based year %G mixed with non-week-based elements.
You'd never use the week-based year %G with a regular month %m or day %d; the combination is suspicious and probably wrong.

Probably, %G is used for formatting a year-week date, like %G-%V: week-based year, plus week-in-a-weak-based year.

I'm not a big fan of run-time warnings that spew something to stderr and the like, and aborting a C program because strftime was called with %G and %m in the same date string seems awfully wrongheaded. It could occur with dynamic strings. These kinds of things could only be done with some API adjustment.

Higher level languages which wrap strftime have more leeway in implementing some of these ideas.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: