2 ms·
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
by tlb 7y ago
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.
- jsnell 7y agoDate 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.