AnsweredAssumed Answered

Setting Short Date-Date variable to text loses a day

Question asked by gman on Mar 29, 2016

Just thought I'd see if anyone else encountered this issue when converting a date variable to text or using the Short Date variant of a Date variable. I'll submit this to support, but wanted to share a work-around if needed.

 

I started with a date variable that's in a query to another list - dateRecDate. If I check the date that comes back, it matches what's in the record (9/22/1992 12:00 AM).

If I do the query again, but store the result in a text variable - txtRecDate, it again comes back with what's in the record.

However, if I take the dateRecDate variable and save that as a text variable (see below) to get the "Short Date" variant - it changes the date by subtracting one day. The result is then - 9/21/1992.

 

 

In order to get the correct short date, I need to take the text version of the date (txtRecDate) and reformat it using the inline function fn-FormatDate using one fo the two formats below:

fn-FormatDate({WorkflowVariable:txtRecDate},mm/dd/yyyy)

fn-FormatDate({WorkflowVariable:txtRecDate},d)

Outcomes