SetDateFormat
- Last UpdatedOct 29, 2026
- 2 minute read
SetDateFormat sets the separator and format for displaying date strings.
|
Function |
Group |
Execution |
String Exp. |
Windows |
Windows Embedded |
IoT View |
Thin Clients |
Mobile Access |
|---|---|---|---|---|---|---|---|---|
|
SetDateFormat |
System Info |
Synchronous |
No |
Supported |
Supported |
Not supported |
Supported |
Not supported |
Syntax
SetDateFormat(strSeparator, strFomat)
strSeparator
The separator character for the date string. You can specify any single character, but the most common characters are "/" and "-".
strFormat
A string that specifies the order of the Month (M), Day (D), and Year (Y) in the date string. You can specify any combination in any order, but the most common examples are shown in the following table:
|
Value |
Description |
|---|---|
|
DMY |
Day, Month, Year (for example, DD/MM/YYYY) |
|
MDY |
Month, Day, Year (for example, MM/DD/YYYY) |
|
YMD |
Year, Month, Day (for example, YYYY/MM/DD) |
Returned value
This function returns one of the following possible values:
|
Value |
Description |
|---|---|
|
0 |
Invalid parameter(s). |
|
1 |
Valid parameters. |
The function only checks whether the parameters are valid, before it tries to use those parameters to set the date format. The function does not return any value to indicate whether the date format is successfully set.
Notes
This function sets the date format only for the station (that is, the project runtime server or project thin client) on which the function is executed. Each station can have its own date format. Also, this function sets the date format only for the AVEVA Edge software itself; it does not change the date format used by the operating system. For more information, see About the date format and how to change it.
Examples
Set the date format so that January 23, 2015, is displayed as "01/23/2015":
SetDateFormat("/", "MDY")
Set the date format so that January 23, 2015, is displayed as "2015-01-23":
SetDateFormat("-", "YMD")