A subsecond precision x
cannot be widened. You cannot widen from, say,
"millisecond"
to "nanosecond"
precision. clock operates under the
philosophy that once you have set the subsecond precision of a calendar,
it is "locked in" at that precision. If you expected this to multiply
the milliseconds by 1e6 to get to nanosecond precision, you probably
want to convert to a time point first, and use time_point_cast()
.
Generally, clock treats calendars at a specific precision as a range of
values. For example, a month precision year-month-day is treated as a range
over [yyyy-mm-01, yyyy-mm-last]
, with no assumption about the day of the
month. However, occasionally it is useful to quickly widen a calendar,
assuming that you want the beginning of this range to be used for each
component. This is where calendar_widen()
can come in handy.