Converts a date string to a timestamp.

  • Parameters

    • Optionalstr: string

      The date string to convert.

    Returns number

    • The timestamp if the conversion is successful, -1 otherwise.