Format date to string not converting timezone from Current Date

  • 14 October 2021
  • 2 replies
  • 174 views

Userlevel 4
Badge +12

Just thought I'd share an issue I had with the format date to string action.

20081i5509FE07695676E5.png

 

I was using to convert a date (Current date) in DD-MM-YYYY format from the current date to Australia/Sydney timezone.

When we tested it, it was not working. It was showing as the previous day. 

20082i102C0922861A34B8.png

 

What we had to do was change from using the [Current Date] workflow context to [Current Date and Time]. After this is worked fine.

 

20083iC251AAA99B018703.png

 

Just thought I'd share in case anyone stumbles down this path of using the wrong context.

 


2 replies

Userlevel 5
Badge +13

@Gavin-Adams Just for some context on why, the current date would be midnight UTC time if you don't use the time component. This would mean if you convert its going to be yesterday unless you add time to the date.

Userlevel 4
Badge +12
Yes I think in our initial testing we must have been doing testing the afternoon. When we came back and looked at it this week we spotted the error (well only till 11am Sydney time) 🙂

Reply