@@ -618,14 +618,14 @@ def test_time_with_datetime_fallback
618
618
assert_equal Time . time_with_datetime_fallback ( :utc , 2005 , 2 , 21 , 17 , 44 , 30 ) , Time . utc ( 2005 , 2 , 21 , 17 , 44 , 30 )
619
619
assert_equal Time . time_with_datetime_fallback ( :local , 2005 , 2 , 21 , 17 , 44 , 30 ) , Time . local ( 2005 , 2 , 21 , 17 , 44 , 30 )
620
620
assert_equal Time . time_with_datetime_fallback ( :utc , 2039 , 2 , 21 , 17 , 44 , 30 ) , DateTime . civil ( 2039 , 2 , 21 , 17 , 44 , 30 , 0 )
621
- assert_equal Time . time_with_datetime_fallback ( :local , 2039 , 2 , 21 , 17 , 44 , 30 ) , DateTime . civil ( 2039 , 2 , 21 , 17 , 44 , 30 , DateTime . local_offset )
621
+ assert_equal Time . time_with_datetime_fallback ( :local , 2039 , 2 , 21 , 17 , 44 , 30 ) , DateTime . civil_from_format ( :local , 2039 , 2 , 21 , 17 , 44 , 30 )
622
622
assert_equal Time . time_with_datetime_fallback ( :utc , 1900 , 2 , 21 , 17 , 44 , 30 ) , DateTime . civil ( 1900 , 2 , 21 , 17 , 44 , 30 , 0 )
623
623
assert_equal Time . time_with_datetime_fallback ( :utc , 2005 ) , Time . utc ( 2005 )
624
624
assert_equal Time . time_with_datetime_fallback ( :utc , 2039 ) , DateTime . civil ( 2039 , 1 , 1 , 0 , 0 , 0 , 0 )
625
625
assert_equal Time . time_with_datetime_fallback ( :utc , 2005 , 2 , 21 , 17 , 44 , 30 , 1 ) , Time . utc ( 2005 , 2 , 21 , 17 , 44 , 30 , 1 ) #with usec
626
626
# This won't overflow on 64bit linux
627
627
unless time_is_64bits?
628
- assert_equal Time . time_with_datetime_fallback ( :local , 1900 , 2 , 21 , 17 , 44 , 30 ) , DateTime . civil ( 1900 , 2 , 21 , 17 , 44 , 30 , DateTime . local_offset , 0 )
628
+ assert_equal Time . time_with_datetime_fallback ( :local , 1900 , 2 , 21 , 17 , 44 , 30 ) , DateTime . civil_from_format ( :local , 1900 , 2 , 21 , 17 , 44 , 30 )
629
629
assert_equal Time . time_with_datetime_fallback ( :utc , 2039 , 2 , 21 , 17 , 44 , 30 , 1 ) ,
630
630
DateTime . civil ( 2039 , 2 , 21 , 17 , 44 , 30 , 0 , 0 )
631
631
assert_equal ::Date ::ITALY , Time . time_with_datetime_fallback ( :utc , 2039 , 2 , 21 , 17 , 44 , 30 , 1 ) . start # use Ruby's default start value
@@ -647,10 +647,10 @@ def test_utc_time
647
647
648
648
def test_local_time
649
649
assert_equal Time . local_time ( 2005 , 2 , 21 , 17 , 44 , 30 ) , Time . local ( 2005 , 2 , 21 , 17 , 44 , 30 )
650
- assert_equal Time . local_time ( 2039 , 2 , 21 , 17 , 44 , 30 ) , DateTime . civil ( 2039 , 2 , 21 , 17 , 44 , 30 , DateTime . local_offset )
650
+ assert_equal Time . local_time ( 2039 , 2 , 21 , 17 , 44 , 30 ) , DateTime . civil_from_format ( :local , 2039 , 2 , 21 , 17 , 44 , 30 )
651
651
652
652
unless time_is_64bits?
653
- assert_equal Time . local_time ( 1901 , 2 , 21 , 17 , 44 , 30 ) , DateTime . civil ( 1901 , 2 , 21 , 17 , 44 , 30 , DateTime . local_offset )
653
+ assert_equal Time . local_time ( 1901 , 2 , 21 , 17 , 44 , 30 ) , DateTime . civil_from_format ( :local , 1901 , 2 , 21 , 17 , 44 , 30 )
654
654
end
655
655
end
656
656
0 commit comments