def date_to_micro()

in python/activation/main.py [0:0]


  def date_to_micro(self, date_str):
    """
    Converts a date string to a microsecond timestamp.

    Args:
      date_str: The date string to be converted.

    Returns:
      The microsecond timestamp.
    """
    try:  # try if date_str with date time format
      return int(datetime.datetime.strptime(date_str, self.date_time_format).timestamp() * 1E6)

    except Exception as e:
      return int(datetime.datetime.strptime(date_str, self.date_format).timestamp() * 1E6)