Closed jiahao closed 10 years ago
I realize now that MM is month and mm is minute. Oops
julia> Datetime.dt2string(Datetime.DateTimeFormat("MM:dd:yyyy hh:mm"),"08:05:2009 16:12")
2009-08-05T00:12:00 UTC
Under the new parsing machinery I mentioned in the other issue, here are the outputs:
In [15]: Datetime("18/05/2009","mm/dd/yyyy")
Out [15]: Month out of range
while loading In[15], in expression starting on line 1
In [16]: Datetime("18/05/2009 16","mm/dd/yyyy hh")
Out [16]: Month out of range
while loading In[16], in expression starting on line 1
In [17]: Datetime("18/05/2009 16:12","mm/dd/yyyy hh:mm")
Out [17]: Month out of range
while loading In[17], in expression starting on line 1
In [18]: Datetime("18:05:2009","mm/dd/yyyy")
Out [18]: Month out of range
while loading In[18], in expression starting on line 1
In [19]: Datetime("18/05/2009","dd/mm/yyyy")
Out [19]: 2009-05-18T00:00:00 UTC
In [20]: Datetime("18/05/2009 16","dd/mm/yyyy HH")
Out [20]: 2009-05-18T16:00:00 UTC
In [21]: Datetime("18/05/2009 16:12","dd/mm/yyyy HH:MM")
Out [21]: 2009-05-18T16:12:00 UTC
In [22]: Datetime("18:05:2009","dd:mm:yyyy")
Out [22]: 2009-05-18T00:00:00 UTC
In [23]:
Clearly, we're doing better with the update on error messages.
Fixed in new dev
branch. ed8123ede2e316a181a781ecd54fd735657b6cd8
I'm not sure why the parsing is failing for these particular cases: