File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -1212,6 +1212,20 @@ def test_strptime_leap_year(self):
12121212 date .strptime ('20-03-14' , '%y-%m-%d' )
12131213 date .strptime ('02-29,2024' , '%m-%d,%Y' )
12141214
1215+ def test_strptime_C99_shorthand_year_month_day (self ):
1216+ formats = dict (short = "%F" ,long = "%Y-%m-%d" )
1217+ test_date = "2025-10-26"
1218+ shorthand = datetime .strptime (test_date ,formats ["short" ])
1219+ long_hand = datetime .strptime (test_date ,formats ["long" ])
1220+ self .assertEqual (shorthand ,long_hand )
1221+
1222+ def test_strptime_C99_shorthand_hour_minute_second (self ):
1223+ formats = dict (short = "%T" ,long = "%H:%M:%S" )
1224+ test_time = "15:00:00"
1225+ shorthand = datetime .strptime (test_time ,formats ["short" ])
1226+ long_hand = datetime .strptime (test_time ,formats ["long" ])
1227+ self .assertEqual (shorthand ,long_hand )
1228+
12151229class SubclassDate (date ):
12161230 sub_var = 1
12171231
You can’t perform that action at this time.
0 commit comments