<s> import datetime <EOL> fmt = '<STR_LIT>' ; <EOL> ofmt = fmt + '<STR_LIT>' <EOL> ZERO = datetime . timedelta ( <NUM_LIT:0> ) <EOL> HOUR = datetime . timedelta ( hours = <NUM_LIT:1> ) <EOL> class UTC ( datetime . tzinfo ) : <EOL> def utcoffset ( self , dt ) : <EOL> return ZERO <EOL> def tzname ( self , dt ) : <EOL> return "<STR_LIT>" <EOL> def dst ( self , dt ) : <EOL> return ZERO <EOL> utc = UTC ( ) <EOL> class FixedOffset ( datetime . tzinfo ) : <EOL> def __init__ ( self , offset , name ) : <EOL> print ( "<STR_LIT>" % offset ) <EOL> self . _offset = datetime . timedelta ( minutes = offset ) <EOL> self . _name = name <EOL> def utcoffset ( self , dt ) : <EOL> return self . _offset <EOL> def tzname ( self , dt ) : <EOL> return self . _name <EOL> def dst ( self , dt ) : <EOL> return ZERO <EOL> dates = [ <EOL> ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) , <EOL> ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) , <EOL> ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) , <EOL> ] ; <EOL> def parse_timezone ( tzspec ) : <EOL> if tzspec [ <NUM_LIT:0> ] in "<STR_LIT>" : <EOL> offset = int ( tzspec [ <NUM_LIT:1> : <NUM_LIT:3> ] , <NUM_LIT:10> ) * <NUM_LIT> + int ( tzspec [ <NUM_LIT:3> : <NUM_LIT:5> ] , <NUM_LIT:10> ) <EOL> offset *= ( - <NUM_LIT:1> if tzspec [ <NUM_LIT:0> ] == "<STR_LIT:->" else <NUM_LIT:1> ) <EOL> return FixedOffset ( offset , tzspec ) <EOL> elif tzspec [ <NUM_LIT:0> ] == "<STR_LIT::>" : <EOL> print ( "<STR_LIT>" , tzspec ) <EOL> return UTC ( ) <EOL> else : <EOL> return UTC ( ) <EOL> def fixup ( indate , tzspec ) : <EOL> dt = datetime . datetime . strptime ( indate , fmt ) <EOL> print ( dt , "<STR_LIT>" ) <EOL> tz = parse_timezone ( tzspec ) <EOL> dt = dt . replace ( tzinfo = tz ) <EOL> print ( dt , "<STR_LIT>" ) <EOL> dt = dt . astimezone ( utc ) <EOL> print ( dt , "<STR_LIT>" ) <EOL> return dt . strftime ( fmt ) <EOL> for i in dates : <EOL> indate , inzone , outdate = i <EOL> out = fixup ( indate , inzone ) <EOL> print ( "<STR_LIT>" % ( "<STR_LIT>" if out == outdate else "<STR_LIT>" , outdate , out ) ) </s>
