getCurrentDateString¶
Returns the current date as a String in the specified format.
Parameters¶
Combine the parameters as a JSON structure as input.
Parameter | Mandatory/Optional | Data Type | Description |
---|---|---|---|
pattern | Mandatory | String | The format of the date to be returned. |
timezone | Optional | String | The timezone for the returned date/time, such as GMT for Greenwich Mean Time. If not specified, GMT is used by default. |
locale | Optional | String |
|
Return Values¶
Value | Data Type | Description |
---|---|---|
value | String | The current date in the format specified in pattern . |
Samples¶
var format = tools.DateUtil.getCurrentDateString({"pattern":"EEE yyyy-MM-dd hh:mm:ss","timezone":"GMT","locale":"EN"});
return tools.resultBuilder.build(true, JSON.stringify(format));
Output
"Fri 2021-04-09 08:02:08"