Browse files

Bug 873: riak_err UTC time formatting is broken

Accomodate the return value from calendar:local_time_to_universal_time_dst/1
which can return 0, 1, or 2 times.  Weird that the original OTP code
doesn't have this problem....
  • Loading branch information...
1 parent b9d2e1e commit 3c5287283bde0296b338eb700c68142c65b8c97d @slfritchie slfritchie committed Nov 9, 2010
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/riak_err_stdlib.erl
View
6 src/riak_err_stdlib.erl
@@ -55,7 +55,11 @@ maybe_utc(Time) ->
end,
if
UTC =:= true ->
- {utc, calendar:local_time_to_universal_time_dst(Time)};
+ UTCTime = case calendar:local_time_to_universal_time_dst(Time) of
+ [] -> calendar:local_time();
+ [T0|_] -> T0
+ end,
+ {utc, UTCTime};
true ->
Time
end.

0 comments on commit 3c52872

Please sign in to comment.