Fixed
Details
Details
Assignee
Pothys - MitrahSoft
Pothys - MitrahSoftReporter
Daemach Laratin
Daemach LaratinLabels
New Issue warning screen
Before you create a new Issue, please post to the mailing list first https://dev.lucee.org
Once the issue has been verified, one of the Lucee team will ask you to file an issue
Sprint
None
Fix versions
Affects versions
Priority
Created 2 September 2019 at 23:56
Updated 2 December 2024 at 00:48
Resolved 15 April 2021 at 11:15
It would be very helpful for dateTimeFormat() to have a mask option to return epoch time for a given datetime rather than trying to hunt down the java function or write a UDF that does that. I don't know java (at all). I've been a CF user since the Allaire days. When I want to format a datetime in a specific format, I go to the datetimeformat() function first, and epoch time is just another datetime format. Because java should do most of the heavy lifting for you, it should be quick for you to implement something like the following:
```
if (mask == 'epoch'){
return inputDate.getTime()/1000;
} else if (mask == 'epochMS'){
return inputDate.getTime();
}
```
Please see this thread for more detail, and thank you for all that you do! Lucee is so much better than ACF!: https://dev.lucee.org/t/please-add-a-datetimeformat-mask-that-returns-epoch-time/5921/7