Flow Designer - Flow Variable for Date and Time

Damian Mudge
Tera Expert

Hi All.

 

I am looking for assistance with defining a flow variable a date and timestamp in a new Chase Function I am desiging using Flow Designer.

 

I have defined the flow and it triggers as expected, waits a specific duration as expected, looks up the trigger record to check it still meets the criteria to update the trigger record as expected and then it updates a number if fields on the trigger record. 

 

The issue I am having is getting a date and timestamp added to the trigger record which I want to populate a new "last chase sent" date and time field with the current time in local time.

 

 

The following flow variable returns the date and time in UTC:

 

Script:

var gdt = new GlideDateTime();
return gdt.getValue();
 
Output:
2024-09-12 14:47:48 which is UTC.
 
The following flow variable returns the time in with the local time but with the Month and Day reversed which is seen as 3 months from now:

 

Script:

var gdt = new GlideDateTime();
return gdt2 = new GlideDateTime(gdt.getDisplayValue());
 
Output:
09-12-2024 15:47:48
 
DamianMudge_1-1726217348933.png

 

What do I need to do so that the output is follows which will populate a "Last Chase Sent" date field in the desired format:
 
Desired Outputs:
12-09-2024 15:47:48
2024-09-12 15:47:48
 
This new "Date last sent" field will be updated by the actions of the flow with the date and time the last flow action was completed and will be used later in the process to see if this value is 24hrs or more before the a new flow variable capturing the current date and time NOW.
 
Any guidance would be much appreciated.