Menu

Expand
Rate this page:

Twilio.TIME

The Twilio.TIME built-in field enables Autopilot to understand times expressed by users in different ways and converts to a standard 24-hour time.

Absolute Times

Absolute times are converted from natural language input to the standard date format.

Example input Example Output
1PM 13:00
10:30 in the morning 10:30
8:30 at night 20:30
11PM 23:00

Relative Times

Relative times have the following properties:

  • Future times are implied by default when missing an indication of past or future.
  • UTC is used as the base time zone.

Below are some examples of relative times. For the examples, we provide the current input, the current time when the input is evaluated and the example output.

Example input Current Time Example Output Notes
now 13:00Z 13:00Z Note that the time will be the UTC time denoted by a 'Z' at the end.
in an hour 13:00Z 14:00Z Note that the time will be the UTC time denoted by a 'Z' at the end.
in 2 hours 13:00Z 15:00Z Note that the time will be the UTC time denoted by a 'Z' at the end.
a minute ago 13:00Z 12:59Z Note that the time will be the UTC time denoted by a 'Z' at the end.
in ten minutes 13:00Z 13:10Z Note that the time will be the UTC time denoted by a 'Z' at the end.
15 minutes ago 13:00Z 12:45Z Note that the time will be the UTC time denoted by a 'Z' at the end.

Rate this page:

Need some help?

We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd by visiting Twilio's Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.

Loading Code Sample...
        
        
        

        Thank you for your feedback!

        Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

        Sending your feedback...
        🎉 Thank you for your feedback!
        Something went wrong. Please try again.

        Thanks for your feedback!

        thanks-feedback-gif