- Print
Learn how to modify and manipulate datetime data in Tulip using the Expressions Editor.
When working with datetime data, you may want to alter it in your application. Using expressions, you can add or subtract a given duration of time, round the datetime to a given unit, or use a typecasting expression to change the data type. Let’s examine these scenarios and how you can use expressions to modify your datetime data.
NOTE: For some of these expressions, you are required to include a timezone in the expression. View this website for a list of supported timezones.
add_time()
Adds a given duration unit to a given time
subtract_time()
Subtracts a given duration unit from a given time
rounddatetime()
Truncates a date to the given unit
Using the above expression, the datetime will round to the nearest day like so:
Typecasting Datetime
The following expressions typecast existing data types into different ones, changing the format and allowing you to use them in different contexts.
datetimetotext()
Changes a given datetime data type to a text data type
texttodatetime()
Changes a given text data type to a datetime data type
Did you find what you were looking for?
You can also head to community.tulip.co to post your question or see if others have faced a similar question!