File tree Expand file tree Collapse file tree 3 files changed +16
-2
lines changed
Expand file tree Collapse file tree 3 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -1098,7 +1098,10 @@ def __repr__(self) -> str:
10981098 return f"{ self .__class__ .__name__ } ({ str (self )!r} )"
10991099
11001100 def __str__ (self ) -> str :
1101- return self .strftime ("%Y-%m-%dT%H:%M:%SZ" )
1101+ text = self .strftime ("%Y-%m-%dT%H:%M:%S%z" )
1102+ if text .endswith ("+0000" ):
1103+ return f"{ text [:- 5 ]} Z"
1104+ return f"{ text [:- 2 ]} :{ text [- 2 :]} "
11021105
11031106 def __add__ (self , other : Any ) -> 'TimestampType' :
11041107 """Timestamp + Duration -> Timestamp"""
Original file line number Diff line number Diff line change @@ -339,6 +339,17 @@ def test_timestamp_type():
339339 assert ts_1 .getSeconds () == IntType (30 )
340340
341341
342+ def test_timestamp_type_issue_28 ():
343+ utc = TimestampType ('2020-10-20T12:00:00Z' )
344+ not_utc = TimestampType ('2020-10-20T12:00:00-05:00' )
345+
346+ assert repr (utc ) == "TimestampType('2020-10-20T12:00:00Z')"
347+ assert repr (not_utc ) == "TimestampType('2020-10-20T12:00:00-05:00')"
348+
349+ assert utc != not_utc
350+ assert str (utc ) != str (not_utc )
351+
352+
342353def test_extended_timestamp_type ():
343354 others = {
344355 'et' : 'US/Eastern' ,
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ celpy.__main__ 465 172 7 42 244 0
55celpy.adapter 137 35 3 9 85 5
66celpy.c7nlib 1584 340 15 154 1075 0
77celpy.celparser 402 208 2 23 169 0
8- celpy.celtypes 1500 435 14 221 791 39
8+ celpy.celtypes 1503 438 14 221 791 39
99celpy.evaluation 2471 839 33 176 1408 15
1010xlate 0 0 0 0 0 0
1111xlate.c7n_to_cel 1730 387 102 145 1091 5
You can’t perform that action at this time.
0 commit comments