parameters: (utctime, localtimezone, currentlogger = None)
return_statement: return np.timedelta64(shift.seconds, 's')
docstring: Calculate the difference between UTC time and local time of given
      DataAndTime
docstring_summary: Calculate the difference between UTC time and local time of given
      DataAndTime
docstring_tokens: Calculate the difference between UTC time and local time of given DataAndTime
function: def getLocalTimeShiftInSecond(utctime, localtimezone, currentlogger = None):
      """ Calculate the difference between UTC time and local time of given
      DataAndTime
      """
      from datetime import datetime
      from dateutil import tz
  
      if currentlogger:
          currentlogger.information("Input UTC time = %s" % (str(utctime)))
  
      # Return early if local time zone is UTC
      if localtimezone == "UTC":
          return 0
  
      # Find out difference in time zone
      from_zone = tz.gettz('UTC')
      to_zone = tz.gettz(localtimezone)
  
      t1str = (str(utctime)).split('.')[0].strip()
      if currentlogger:
          currentlogger.information("About to convert time string: %s" % t1str)
      try:
          if t1str.count("T") == 1:
              utc = datetime.strptime(t1str, '%Y-%m-%dT%H:%M:%S')
          else:
              utc = datetime.strptime(t1str, '%Y-%m-%d %H:%M:%S')
      except ValueError as err:
          raise err
  
      utc = utc.replace(tzinfo=from_zone)
      sns = utc.astimezone(to_zone)
  
      newsns = sns.replace(tzinfo=None)
      newutc = utc.replace(tzinfo=None)
  
      shift = newutc-newsns
      return np.timedelta64(shift.seconds, 's')
function_tokens: def getLocalTimeShiftInSecond ( utctime , localtimezone , currentlogger = None ) : from datetime import datetime from dateutil import tz if currentlogger : currentlogger . information ( "Input UTC time = %s" % ( str ( utctime ) ) ) # Return early if local time zone is UTC if localtimezone == "UTC" : return 0 # Find out difference in time zone from_zone = tz . gettz ( 'UTC' ) to_zone = tz . gettz ( localtimezone ) t1str = ( str ( utctime ) ) . split ( '.' ) [ 0 ] . strip ( ) if currentlogger : currentlogger . information ( "About to convert time string: %s" % t1str ) try : if t1str . count ( "T" ) == 1 : utc = datetime . strptime ( t1str , '%Y-%m-%dT%H:%M:%S' ) else : utc = datetime . strptime ( t1str , '%Y-%m-%d %H:%M:%S' ) except ValueError as err : raise err utc = utc . replace ( tzinfo = from_zone ) sns = utc . astimezone ( to_zone ) newsns = sns . replace ( tzinfo = None ) newutc = utc . replace ( tzinfo = None ) shift = newutc - newsns return np . timedelta64 ( shift . seconds , 's' )