Click or drag to resize

TimePsz Function

X#
Return the system time in a format determined by various international settings.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.19
Syntax
 FUNCTION TimePsz() AS PSZ
Request Example View Source

Return Value

Type: Psz
The format of the return value is dependent on several functions, including SetAMPM(), SetAMExt(), SetPMExt(), and SetInternational(), which you can refer to for more information.
Remarks
Tip Tip
The PSZ type is included in the X# language and runtime for compatibility only. In most cases the type can and should be replaced with normal strings.
If you need to interface with Win32 API functions that expect an ansi string, there is often also an alternative with a unicode string. We recommend to use that alternative when possible.
Examples
These examples show the results of Time() under various circumstances:
X#
1SetInternational(#Windows)
2// Assuming 12-hour time with "AM" and "PM"extensions
3// and colon separator set in Control Panel
4? Time()                    // 02:37:17 PM
5SetInternational(#Clipper)
6? Time()                    // 14:37:19
7SetAMPM(TRUE)            // 12-hour format
8SetPMExt(" pm")
9? Time()                    // 02:37:21 pm
See Also