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
How to format date in email?
Re: How to format date in email?
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
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