dateTimeFormat¶
Converts a date/time (String) from one format to another.
Parameters¶
Combine the parameters as a JSON structure as input.
Parameter |
Mandatory/Optional |
Data Type |
Description |
---|---|---|---|
inString |
Mandatory |
String |
The date/time to convert. |
currentPattern |
Mandatory |
String |
The |
newPattern |
Mandatory |
String |
The format to convert |
locale |
Optional |
String |
|
lenient |
Mandatory |
String |
|
Return Values¶
Value |
Data Type |
Description |
---|---|---|
value |
String |
The |
Samples¶
var format = tools.DateUtil.dateTimeFormat({"inString":"2021-04-01 05:13:02","currentPattern":"yyyy-MM-dd hh:mm:ss","newPattern":"EEE dd MMM YYYY hh:mm:ss","lenient":true,"locale":"EN"});
return tools.resultBuilder.build(true, JSON.stringify(format));
Output
"Thu 01 Apr 2021 05:13:02"