From f529143f81bf044d6abe0b63fb7ac37907fd4f7c Mon Sep 17 00:00:00 2001 From: Jimmy Olgeni Date: Fri, 28 Feb 2020 17:12:49 +0000 Subject: Copy lang/erlang-runtime22 to erlang-runtime23. --- .../files/patch-lib_stdlib_src_calendar.erl | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 lang/erlang-runtime23/files/patch-lib_stdlib_src_calendar.erl (limited to 'lang/erlang-runtime23/files/patch-lib_stdlib_src_calendar.erl') diff --git a/lang/erlang-runtime23/files/patch-lib_stdlib_src_calendar.erl b/lang/erlang-runtime23/files/patch-lib_stdlib_src_calendar.erl new file mode 100644 index 000000000000..34b753d85b27 --- /dev/null +++ b/lang/erlang-runtime23/files/patch-lib_stdlib_src_calendar.erl @@ -0,0 +1,26 @@ +--- lib/stdlib/src/calendar.erl.orig 2015-03-31 12:32:52 UTC ++++ lib/stdlib/src/calendar.erl +@@ -279,11 +279,19 @@ local_time_to_universal_time(DateTime, I + DateTime1 :: datetime1970(), + DateTime :: datetime1970(). + local_time_to_universal_time_dst(DateTime) -> +- UtDst = erlang:localtime_to_universaltime(DateTime, true), +- Ut = erlang:localtime_to_universaltime(DateTime, false), + %% Reverse check the universal times +- LtDst = erlang:universaltime_to_localtime(UtDst), +- Lt = erlang:universaltime_to_localtime(Ut), ++ {UtDst, LtDst} = ++ try ++ UtDst0 = erlang:localtime_to_universaltime(DateTime, true), ++ {UtDst0, erlang:universaltime_to_localtime(UtDst0)} ++ catch error:badarg -> {error, error} ++ end, ++ {Ut, Lt} = ++ try ++ Ut0 = erlang:localtime_to_universaltime(DateTime, false), ++ {Ut0, erlang:universaltime_to_localtime(Ut0)} ++ catch error:badarg -> {error, error} ++ end, + %% Return the valid universal times + case {LtDst,Lt} of + {DateTime,DateTime} when UtDst =/= Ut -> -- cgit v1.2.3