def get_timezone_gmt(datetime=None, width='long', locale=LC_TIME):
 if (datetime is None):
  datetime = datetime_.utcnow()
 elif isinstance(datetime, (int, long)):
  datetime = datetime_.utcfromtimestamp(datetime).time()
 if (datetime.tzinfo is None):
  datetime = datetime.replace(tzinfo=UTC)
 locale = Locale.parse(locale)
 offset = datetime.tzinfo.utcoffset(datetime)
 seconds = ((((offset.days * 24) * 60) * 60) + offset.seconds)
 (hours, seconds) = divmod(seconds, 3600)
 if (width == 'short'):
  pattern = u'%+03d%02d'
 else:
  pattern = (locale.zone_formats['gmt'] % '%+03d:%02d')
 return (pattern % (hours, (seconds // 60)))

def get_timezone_gmt ( datetime = None , width = 'long' , locale = LC_TIME ) : if ( datetime is None ) : datetime = datetime_ . utcnow ( ) elif isinstance ( datetime , ( int , long ) ) : datetime = datetime_ . utcfromtimestamp ( datetime ) . time ( ) if ( datetime . tzinfo is None ) : datetime = datetime . replace ( tzinfo = UTC ) locale = Locale . parse ( locale ) offset = datetime . tzinfo . utcoffset ( datetime ) seconds = ( ( ( ( offset . days * 24 ) * 60 ) * 60 ) + offset . seconds ) ( hours , seconds ) = divmod ( seconds , 3600 ) if ( width == 'short' ) : pattern = u'%+03d%02d' else : pattern = ( locale . zone_formats [ 'gmt' ] % '%+03d:%02d' ) return ( pattern % ( hours , ( seconds // 60 ) ) )
return the timezone associated with the given datetime object formatted as string indicating the offset from gmt .