ftos.convert.date.toUtcDateAsString
IMPORTANT!
Starting with v24.3.0, this is renamed from toUtcDateStr to ftos.convert.date.toUtcDateAsString.
Starting with v24.3.0, this is renamed from toUtcDateStr to ftos.convert.date.toUtcDateAsString.
Generates a string representation of a date using the UTC formatting conventions.
This is a method suitable for all business service components.
Syntax
function ftos.convert.date.toUtcDateAsString(inputDate: any): string
| Parameter | Description |
|---|---|
inputDate
|
Date object or string representing a date. |
Return Value
Returns a string representing the date based on the UTC formatting conventions.
Examples
In this example:
- We store the current date and time using the UTC formatting conventions in a variable called message.
- We display the message on screen. For details on how to display messages, see ftos.context.response.setMessage.
message = ftos.convert.date.toUtcDateAsString(new Date()); ftos.context.response.setMessage(message);
In this example, we store a string representation of a customer's Birthday (January 20th 1971) using the UTC formatting conventions.
customer.Birthday = ftos.convert.date.toUtcDateAsString('1971, 1, 20');