#NEWLINE# @ register . filter #NEWLINE# def to_global_tz( value , from_timezone = None ) : #NEWLINE# #INDENT# with_tzinfo = ( value . tzinfo is not None ) #NEWLINE# from_timezone = ( from_timezone or value . tzinfo or pytz . timezone ( settings . TIME_ZONE ) ) #NEWLINE# value = adjust_datetime_to_timezone ( value , from_timezone , global_tz . get_timezone ( ) ) #NEWLINE# if with_tzinfo : #NEWLINE# #INDENT# return value #NEWLINE# #UNINDENT# return value . replace ( tzinfo = None )