Skip to content

Commit

Permalink
accept binary or string for Timezone (#6434)
Browse files Browse the repository at this point in the history
  • Loading branch information
lazedo authored Apr 1, 2020
1 parent 8a8376c commit 2b5e626
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/kazoo_stdlib/src/kz_time.erl
Original file line number Diff line number Diff line change
Expand Up @@ -481,8 +481,8 @@ adjust_utc_timestamp(_Timestamp, <<"+", _/binary>>) ->
throw({'error', 'invalid_offset'});
adjust_utc_timestamp(_Timestamp, <<"-", _/binary>>) ->
throw({'error', 'invalid_offset'});
adjust_utc_timestamp(Timestamp, <<Timezone/binary>>) when is_integer(Timestamp) ->
try localtime:utc_to_local(calendar:gregorian_seconds_to_datetime(Timestamp), kz_term:to_list(Timezone)) of
adjust_utc_timestamp(Timestamp, Timezone) when is_integer(Timestamp) ->
try localtime:utc_to_local(calendar:gregorian_seconds_to_datetime(Timestamp), Timezone) of
{{_, _, _}, {_, _, _}} = Datetime ->
calendar:datetime_to_gregorian_seconds(Datetime);
[LocalDatetime, _LocalDstDatetime] ->
Expand Down

0 comments on commit 2b5e626

Please sign in to comment.