This automation is designed to store a specific datetime value in a Tulip Table column of type Datetime. However, I am encountering an issue where the value saved in the column does not match the value that I configured in the automation.
Below is the definition of the datetime value within the automation:
To test this situation, I decided to create a Text column in the table to store the date using the DATETIMETOTEXT() function and later compare both results. Here is how I developed this part.
The values in both columns are different, and the date in the Datetime column Due Date is incorrect. I tested the method of creating datetimes using the expression texttodatetime('31 12 ' + Variables.Current Year + ' 00:00:00', 'DD MM YYYY HH:mm:ss') in the app editor, and it worked as expected.
Do you know why this is failing, and how can it be resolved?
Following up here with the advice from our Support Team for anyone who finds this thread in the future with a similar question -
The format of all datetimes within your instance are determined by the chosen format in ‘Date and Time’ of ‘Account Settings’. This included datetimes in tables.
The reason you are seeing a difference between the two functions TEXTTODATETIME() and DATETIMETOTEXT() is that they output to different datatypes, one outputs text, while the other a datetime.
For the expression TEXTTODATETIME('31 12' + Variables.Current Year + '00:00:00', 'DD MM YYYY HH:mm:ss') the last bit, DD MM YYYY HH:mm:ss does not refer to how the datetime will be formatted, but instead to how the function should read the incoming text. This is what allows the text to be ‘translated’ into a datetime. If you would like all of your datetimes to be in that format (DD MM YYYY HH:mm:ss ) it will need to be changed in the instance settings.