File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -932,14 +932,17 @@ def test_formatdate(self):
932932 else :
933933 matchdate = "I don't understand your epoch"
934934 gdate = Utils .formatdate (now )
935- ldate = Utils .formatdate (now , localtime = 1 )
936935 self .assertEqual (gdate , matchdate )
937936
938- def test_formatdate_zoneoffsets (self ):
937+ def test_formatdate_localtime (self ):
939938 now = 1005327232.109884
940939 ldate = Utils .formatdate (now , localtime = 1 )
941940 zone = ldate .split ()[5 ]
942- offset = int (zone [:3 ]) * - 3600 + int (zone [- 2 :]) * - 60
941+ offset = int (zone [1 :3 ]) * 3600 + int (zone [- 2 :]) * 60
942+ # Remember offset is in seconds west of UTC, but the timezone is in
943+ # minutes east of UTC, so the signs differ.
944+ if zone [0 ] == '+' :
945+ offset = - offset
943946 if time .daylight and time .localtime (now )[- 1 ]:
944947 toff = time .altzone
945948 else :
You can’t perform that action at this time.
0 commit comments