Write the Expression Training: TEXTTODATETIME() help

Hello, I am doing the “Write the Expression” training. I am trying to:

(1) convert a ‘datetime’ to ‘text’
datetimetotext(App Info.Current Date and Time , ‘MM-DD-YYYY’, ‘America/New_York’)
Example result: 01-05-2024

(2) add the converted ‘text’ to an existing ‘text’
Variable.appDateTimeToText + ’ ’ + Table Record.Current Shift.Time End (HH:MM)
Example result: 01-05-2024 17:45

(3) convert the new ‘text’ to a ‘datetime’
texttodatetime(Variable.appDataAndTableRecordText , ‘MM-DD-YYYY hh:mm’, ‘America/New_York’)
Example result: Jan/06/2024 05:45:00

In step 3, the ‘day’ in my ‘datetime’ increments by one and I cannot figure out why? Any ideas?

Hi @kkl - Welcome to the Tulip Community!! :tada: Thanks for your question

First thing that comes to mind is timezones, are you by chance located in a different timezone than EST (‘America/New_York’)? If so, try using your local timezone and see then if your date comes out correctly!

This website has a list of all support timezones PHP: List of Supported Timezones - Manual (found in this Knowledge Base article Typecasting Expressions)

Hi @Beth Thank you! That is of course, the solution! My expression is working as expected now. Thank you very much for pointing that out! I appreciate the help.

1 Like