Skip to content

Commit

Permalink
Fix time parsing
Browse files Browse the repository at this point in the history
Crystal recently updated how it parses dates, but they also added a 
nice 
convenience method that we can use to parse strings since we expect 
them 
to be UTC.
  • Loading branch information
edwardloveall committed Jul 27, 2018
1 parent 189dd64 commit 332511b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lucky_record/charms/time_extensions.cr
Expand Up @@ -8,7 +8,7 @@ struct Time
end

def self.parse(value : String)
SuccessfulCast(Time).new Time.parse(value, "%FT%X%z").to_utc
SuccessfulCast(Time).new Time.parse_iso8601(value).to_utc
rescue Time::Format::Error
FailedCast.new
end
Expand Down

0 comments on commit 332511b

Please sign in to comment.