Converts a string representation of a time to a timestamp.

  • Parameters

    • Optionalstr: string

      The time string to convert. Defaults to the current time.

    Returns number

    • The timestamp representation of the given time or -1 if conversion fails.