Workflow activity | Community
Skip to main content
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Darren_Bowers

One way to do it:

 

var d = new Date(); d.setDate(d.getDate()-1); logInfo("Yesterdays date was: " + d.toLocaleString());

 


Output:
09/04/2020 13:24:33 js Yesterdays date was: Wed Apr 8 13:24:33 2020

Depending on what you need, you can refine the date format further using Javascript

1 reply

Darren_Bowers
Darren_BowersAccepted solution
Level 9
April 9, 2020

One way to do it:

 

var d = new Date(); d.setDate(d.getDate()-1); logInfo("Yesterdays date was: " + d.toLocaleString());

 


Output:
09/04/2020 13:24:33 js Yesterdays date was: Wed Apr 8 13:24:33 2020

Depending on what you need, you can refine the date format further using Javascript

Darren_Bowers
Level 9
April 9, 2020
wow that code formatter is terrible...