Dates and times
John Cowan
(03 Dec 2019 17:08 UTC)
|
||
Re: Dates and times Lassi Kortela (03 Dec 2019 17:20 UTC)
|
||
Re: Dates and times
Lassi Kortela
(03 Dec 2019 17:27 UTC)
|
||
Re: Dates and times
John Cowan
(03 Dec 2019 19:03 UTC)
|
||
Re: Dates and times
Lassi Kortela
(03 Dec 2019 20:00 UTC)
|
||
(missing)
|
||
Re: Dates and times
Lassi Kortela
(14 Dec 2019 13:36 UTC)
|
Re: Dates and times Lassi Kortela 03 Dec 2019 17:20 UTC
> I suggest that instead of two string arguments, you use a single string > argument containing an ISO 8601 style date with optional time: > > yyyy-mm-dd > yyyy-mm-ddThh:mm:ss.ssss > > Note that T is a literal uppercase #\T, and that the fractional second > is optional. Most languages have libraries to parse this format. That may be a good idea. I put the date and time in different strings so it would be easy to get only the date (which I believe people generally want). You raise a good point about library support. And since the date is always in YYYY-MM-DD format, (substring date/time 0 10) could always get it from a combined date/time string even with no fancy parsing. How would this work from awk and grep|sed? When the date is one string, it works the same way parsing as any other string-valued property (i.e. get the first double-quoted string from the list) - no extra parsing is necessary. If the time were in the same string, the user would have to limit it further with something like 'head -c 10'. Note that '-c' is not in Posix.