Hmmm........I guess we could add 0 and 1 definitions if it'll be generally
useful (i.e. Date/DateTime s are ordinals with numeric-like properties, so
being able to define zero/one and have them work with generic functions).

It still just seems a little weird because there's not a real solid
reasoning/meaning. I think one reason a lot of other languages define a
zero(::DateTime) is because values can be "truthy" or "falsey", so you
would compare a date with zero(::DateTime) to check for falseness. In
Julia, you have to use explicit Booleans, so that's not as important a
reason.

Happy to hear other opinions/use cases from people though.

-Jacob

On Sun, Nov 9, 2014 at 9:23 PM, Thomas Covert <[email protected]> wrote:

> To your first question, I'm sure there are good reasons for not having
> zeros in the Date and Time types, but in other languages (i.e., stata),
> dates and times are stored as integers or floats with respect to some
> reference time.  So, I *think* the 0-date in stata refers to January 1,
> 1960.  Obviously this is fairly arbitrary, but there is some precedence for
> it in other languages.
>
> On Sunday, November 9, 2014 8:17:04 PM UTC-6, Jacob Quinn wrote:
>>
>> What Date would represent zero(::Date)? Or one(::Date), for that matter?
>> Doesn't seem like a particularly useful definition. What's the use case?
>>
>> On Sun, Nov 9, 2014 at 9:14 PM, Thomas Covert <[email protected]> wrote:
>>
>>> I'm using Dates.jl on 0.3 and have discovered that there is no zero
>>> defined for the Date or DateTime types.  Is this intentional?
>>>
>>>
>>>
>>

Reply via email to