Date/DateTime are documented as following the proleptic gregorian calendar,
so negative values for the year imply BC/BCE era values.

On Mon, Aug 31, 2015 at 4:06 PM, Michael Francis <[email protected]>
wrote:

> it does seem that typemin and typemax of Date are rather large. It also
> implies that a DateTime can not contain all possible Dates. Given the
> following
>
>
>
> julia> typemin( DateTime )
> -146138511-01-01T00:00:00
>
>
> julia> typemax( DateTime )
> 146138512-12-31T23:59:59
>
>
> I was surprised to see negative values rather than the type being a
> UInt64. But is somewhat makes sense as the types are wrappers on periods
> for period math. So perhaps the issue is that typemin should be floored at
> zero ?
>
>
> On Monday, August 31, 2015 at 5:37:16 PM UTC-4, Jeffrey Sarnoff wrote:
>>
>>
>> What is the utility of a date that predates the advent of time?
>>
>> On Friday, August 28, 2015 at 12:23:28 PM UTC-4, Michael Francis wrote:
>>>
>>> I agree except that people may expect yy-mm-dd to truncate, likely one
>>> of the reasons for the ccyy-mm-dd strict form. Where yy is defined as the
>>> two digit year.
>>>
>>> On Friday, August 28, 2015 at 11:51:14 AM UTC-4, Stefan Karpinski wrote:
>>>>
>>>> The safest option is probably to raise an error.
>>>>
>>>> On Fri, Aug 28, 2015 at 11:47 AM, Jacob Quinn <[email protected]>
>>>> wrote:
>>>>
>>>>> Hmmmmm.......it's not entirely clear to me what we should do here.
>>>>>
>>>>> On the one hand, when you ask to have the typemax(Date) formatted,
>>>>> it's currently doing what you asked, "formatting the year with 4 digits".
>>>>> Because your year in this case is greater than 4 digits, that results in
>>>>> truncation, which probably isn't what you want. But is it ok to give you
>>>>> all the digits even though you only asked for 4? I'd appreciate any other
>>>>> thoughts/input on this.
>>>>>
>>>>> I do think the Date/DateTime parsing/formatting code needs another
>>>>> once over to polish it up, so any ideas on allowing more
>>>>> flexibility/functionality would be appreciated.
>>>>>
>>>>> -Jacob
>>>>>
>>>>>
>>>>>
>>>>> On Friday, August 28, 2015 at 9:33:25 AM UTC-6, Michael Francis wrote:
>>>>>>
>>>>>> It seems that there is an issue with typemax of dates and string
>>>>>> representation
>>>>>>
>>>>>> julia> using Dates
>>>>>>
>>>>>>
>>>>>> julia> Dates.format(typemax( Date ),"yyyy-mm-dd" )
>>>>>> "1149-12-31"
>>>>>>
>>>>>>
>>>>>> julia> typemax( Date )
>>>>>> 252522163911149-12-31
>>>>>>
>>>>>>
>>>>>> julia> Dates.format(typemax( Date ),"yyyyyyyyyyyyyyy-mm-dd" )
>>>>>> "252522163911149-12-31"
>>>>>>
>>>>>> This hidden truncation seems dangerous. Has anybody else seen this ?
>>>>>>
>>>>>
>>>>

Reply via email to