ftos.convert.date.toLocalDateAsString
IMPORTANT!
Starting with v24.3.0, this is renamed from toLocalDateStr to ftos.convert.date.toLocalDateAsString.
Starting with v24.3.0, this is renamed from toLocalDateStr to ftos.convert.date.toLocalDateAsString.
Generates a string representation of a date using the server's local time naming conventions.
This is a method suitable for all business service components.
Syntax
function ftos.convert.date.toLocalDateAsString(inputDate: any): string
| Parameter | Description |
|---|---|
inputDate
|
Date object or string representing a date. |
Return Value
Returns a string representing the date based on server's local time formatting conventions.
Examples
In this example:
- We store the current date and time using the server's local time 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.toLocalDateAsString(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 server's local time formatting conventions.
customer.Birthday = ftos.convert.date.toLocalDateAsString('1971, 1, 20');