Page 1 of 1

How to format date in email?

Posted: 2019-03-22 15:03
by piripacchio
Hello all,
hope someone is still around.
I need to format the date in an email. How can I do that?
The email is sent using the "retrieve content from file" option; so, I created an html file and set my email.
But the date are displayed as yyyy-mm-dd; how can I format them differently? example: dd/mm/yyyy? or, even better: "saturday 6 april 2019"?
TIA
tony

Re: How to format date in email?

Posted: 2019-04-03 22:16
by FlyOTW
In the past I just used java scripting to fix date issues with some scripting like so...

function fixDate(region,lookupFunc) {
var eventDate = lookupFunc("{start_time}");
var datefix = eventDate.replace(/[A-Z][01][0-9]:[0-5][0-9]:[0-9]{2}.[0-9]{4}/, '');
return datefix
}


Also here is the link to date functions in PHP
https://www.php.net/manual/en/function.date.php