I'm not seeing the error on the latest master

               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.4.0-pre+7400 (2015-09-08 22:42 UTC)
 _/ |\__'_|_|_|\__'_|  |  Commit bffe239* (0 days old master)
|__/                   |  x86_64-apple-darwin14.4.0

julia> using Base.Dates

julia> ds = "2015-08-12 12:01:23 PM"
"2015-08-12 12:01:23 PM"

julia> DateTime(ds, DateFormat("yyyy-mm-dd HH:MM:SS")) - (contains(ds,
"AM") ? Hour(12) : Hour(0))
2015-08-12T12:01:23

julia>

On Tue, Sep 8, 2015 at 5:23 PM, Ian Butterworth <[email protected]>
wrote:

> Thanks for the tip, although I'm getting an error with your code in
> 0.4.0-dev
> Any idea why?
>
> using Base.Dates
> ds = "2015-08-12 12:01:23 PM"
> DateTime(ds, DateFormat("yyyy-mm-dd HH:MM:SS")) - (contains(ds, "AM") ?
> Hour(12) : Hour(0))
>
>
> LoadError: ArgumentError: Non-digit character encountered
> while loading In[51], in expression starting on line 3
>
>  in getslot at dates/io.jl:110
>  in parse at dates/io.jl:122
>  in call at dates/io.jl:164
>
>

Reply via email to