Ander Juaristi <[email protected]> wrote: > These keywords introduce new checks for a timestamp, an absolute date (which > is converted to a timestamp), > an hour in the day (which is converted to the number of seconds since > midnight) and a day of week. > > When converting an ISO date (eg. 2019-06-06 17:00) to a timestamp, > we need to substract it the GMT difference in seconds, that is, the value > of the 'tm_gmtoff' field in the tm structure. This is because the kernel > doesn't know about time zones. And hence the kernel manages different > timestamps > than those that are advertised in userspace when running, for instance, date > +%s. > > The same conversion needs to be done when converting hours (e.g 17:00) to > seconds since midnight > as well. > > The result needs to be computed modulo 86400 in case GMT offset (difference > in seconds from UTC) > is negative. > > We also introduce a new command line option (-t, --seconds) to show the actual > timestamps when printing the values, rather than the ISO dates, or the hour.
Pablo, please see this "-t" option -- should be just re-use -n instead? Other than this, this patch looks good and all tests pass for me.
