diff options
Diffstat (limited to 'doc/neps')
-rw-r--r-- | doc/neps/datetime-proposal.rst | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/doc/neps/datetime-proposal.rst b/doc/neps/datetime-proposal.rst index 7f4cd4cea..39e3f7a98 100644 --- a/doc/neps/datetime-proposal.rst +++ b/doc/neps/datetime-proposal.rst @@ -86,8 +86,29 @@ A time unit is specified by a string consisting of a base-type given in the above table Besides these basic code units, the user can create derived units -consisting of rational multiples of any basic unit: 100ns, Y/4, 3M, -32s/42, etc. +consisting of multiples of any basic unit: 100ns, 3M, 15m, etc. + +A limited number of divisions of any basic unit can be used to create multiples +of a higher-resolution unit provided the divisor can be divided evenly into +the number of higher-resolution units available. +For example: Y/4 is just short-hand for -> (12M)/4 -> 3M and Y/4 will be represented + after creation as 3M +The first lower unit found to have an even divisor will be chosen + (up to 3 lower units). The following standardized definitions are used + in this specific case to find acceptable divisors + + +Y - 12M, 52W, 365D +M - 4W, 30D, 720h +W - 5B,7D, 168h, 10080m +B - 24h, 1440m, 86400s +D - 24h, 1440m, 86400s +h - 60m, 3600s +m - 60s, 60000ms + +s, ms, us, ns, ps, fs (use 1000 and 1000000 of the next two + available lower units respectively). + Finally, a date-time data-type can be created with support for tracking sequential events within a basic unit: [D]//100, [Y]//4 (notice the |