Datetime functions
Studio has many functions for working with dates and times. You can use these to calculate durations, convert durations from one time unit to another, and display datetime values in different formats
Many datetime functions take or return a datetime object — see Working with datetime objects for guidance.
Index of datetime functions
Adds a duration to a datetime object. | |
Converts the input value to a datetime object. | |
Converts a duration from seconds to days. | |
Converts a duration from seconds to hours. | |
Converts a duration from seconds to milliseconds. | |
Converts a duration from seconds to minutes. | |
Converts a duration from seconds to months. | |
Converts a duration from seconds to weeks. | |
Converts a duration from seconds to years. | |
Returns the absolute difference (in seconds) between two datetime objects. | |
Returns a number representing the day part of a datetime object. | |
Converts a duration given in seconds to a list of seven duration values. | |
Formats a datetime object using a format pattern or locale. | |
Formats the input duration as a text string. | |
Returns a datetime object for the current date and time. | |
Returns the timezone ID (or offset) for a datetime object. | |
Returns a number representing the hours part of a datetime object. | |
Tests if the input string can be parsed to create a datetime object. | |
Returns a number representing the minutes part of a datetime object. | |
Returns a number representing the month part of a datetime object. | |
Returns the number for the input month name — e.g. 3 for March. | |
Returns the current time. Deprecated — superseded by getCurrentTime. | |
Returns the month name for the input number — e.g. March for 3. | |
Returns the weekday name for the input number — e.g. Tuesday for 2. | |
Parses a string to create a datetime object. | |
Converts a duration string to a number representing the duration in seconds. | |
Returns a number representing the seconds part of a datetime object. | |
Sets the timezone ID (or offset) for a datetime object. | |
Sorts datetime objects in chronological order. | |
Sorts datetime objects in reverse-chronological order. | |
Sorts month names in order of calendar month. | |
Subtracts a duration from a datetime object. | |
Returns the current date. Deprecated — superseded by getCurrentTime. | |
Translates a datetime object into its equivalent in a different timezone. | |
Returns the number for the input weekday name — e.g. 2 for Tuesday. | |
Returns a number representing the year part of a datetime object. |