Closed trevorld closed 1 year ago
In general the following {clock}
coercion methods currently support ...
:
as_date_time()
as_year_quarter_day()
as_zoned_time()
The following {clock}
coercion methods currently do not support ...
:
as_date()
as_duration()
as_iso_year_week_day()
as_naive_time()
as_sys_time()
as_weekday()
as_year_day()
as_year_month_day()
as_year_month_weekday()
Those 3 functions have ...
for very specific reasons:
as_zoned_time()
because this is the only place in the low level API that has nonexistent
and ambiguous
arguments, and that design is purposeful. So the dots are there to separate the required and optional arguments.as_date_time()
because that passes on to as_zoned_time()
, so same reasons applyas_year_quarter_day()
only because it requires an optional start
argument to specify the quarter startAs mentioned elsewhere I do not currently see clock as an extensible system that you can convert in and out of from types that aren't natively supported at this time
As mentioned elsewhere I do not currently see clock as an extensible system that you can convert in and out of from types that aren't natively supported at this time
I don't really understand why as a developer you'd want to deliberately make it harder for users/developers to get their date times into {clock}
ambiguous
argument:Currently
It could be nice to be able to support an
ambiguous
argument:Note since with pdf metadata datetimes we often don't know the time zone but more often know the UTC offsets the current strategy to convert to a zoned time is to first convert to a sys time and then convert to a zoned time. So converting to a zoned time (by first converting to a sys time) to then convert to a sys time would be awkward...