Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What’s the use case for dates in a config language?

crontab is an example that comes to mind, but it uses its own system of date-time patterns. Javascript Date objects wouldnt be suitable.



Date arithmetic, parsing and formatting are very useful in config languages. Maybe your configs needs to express that when a program is run, the input should be read from a log file from two days ago named like /foo/bar/2019/07/02/access.log. That requires knowing what the current time is, computing what the time was two days ago, and formatting it in an arbitrary custom format (in this case YYYY/MM/DD).

That doesn't necessarily mean that the language needs dates as a first class data type with a literal syntax etc.




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

Search: