Yeah, I'd be open to changing the behavior of one-arg `Date()` if there was
enough support. The reason for the current behavior is to provide
consistency, i.e.:

Date(y) -> Date(y,1,1)
Date(y,m) -> Date(y,m,1)

Similarly with DateTime:

DateTime(y,m,d) -> DateTime(y,m,d,0,0,0,0)
etc.

I guess we should at least have a better API for creating a Date/DateTime
from the `Dates.value(dt::Date)` integer value.

-Jacob

On Sat, Dec 20, 2014 at 2:24 PM, Min-Woong Sohn <[email protected]> wrote:

> Thank you so much!
>
>
> On Saturday, December 20, 2014 11:05:26 AM UTC-5, Avik Sengupta wrote:
>>
>>
>> julia> d2=Date(Dates.UTD(715510))
>> 1960-01-01
>>
>> On Saturday, 20 December 2014 03:09:42 UTC, Min-Woong Sohn wrote:
>>>
>>>
>>>
>>> Date("1960/1/1","yyyy/m/d") returns 1960-01-01, whose integer value is
>>> 715510. I want to convert this integer back to Date type. How do I do that?
>>>
>>> Also I noticed that Date(1) returns 0001-01-01 and Date(2) returns
>>> 0002-01-01 and Date(715510) returns 715510-01-01. Isn't this more natural
>>> that Date(2) returns 0001-01-02 and Date(715510) returns 1960-01-01? Just
>>> my opinion.
>>>
>>

Reply via email to