Help Center

CTime64.Formatmethod

Converts a **CTime64** object to a string.

DateTimemethodCTime64.incdocumented

Syntax

FUNCTION Format (BYREF wszFmt AS WSTRING) AS DWSTRING
Also documented as FormatGmt — one description covers them all.

Description

Converts a CTime64 object to a string.

Formatting codes:

The # flag may prefix any formatting code. In that case, the meaning of the format code is changed as follows.

  • %#a, %#A, %#b, %#B, %#p, %#X, %#z, %#Z, %#%: # flag is ignored.
  • %#c: Long date and time representation, appropriate for current locale. For example: "Tuesday, March 14, 1995, 12:41:29".
  • %#x* Long date representation, appropriate to current locale. For example: "Tuesday, March 14, 1995".
  • %#d, %#H, %#I, %#j, %#m, %#M, %#S, %#U, %#w, %#W, %#y, %#Y: Remove leading zeros (if any).

Remarks

Formats the value by using the format string which contains special formatting codes that are preceded by a percent sign (%).

Format uses the local time and FormatGmt the Gmt time.

Example

print ct.Format("%A, %B %d, %Y %H:%M:%S") print ct.FormatGmt("%A, %B %d, %Y %H:%M:%S")

Reference

  • Include file CTime64.inc
  • Defined in AfxNova/CTime64.inc:630
  • Documented in DateTime/CTime64 Class.md
  • Topic: CTime64 Class