Help Center

CFileTime.Formatmethod

Converts a **CFileTime** object to a string.

DateTimemethoddocumented

Syntax

FUNCTION Format (BYREF wszFmt AS WSTRING) AS DWSTRING

Description

Converts a CFileTime 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 (%).

Examples

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

DIM cft AS CFileTime cft = AfxLocalFileTime print cft.Format("%A, %B %d, %Y %H:%M:%S")

Reference

  • Defined in AfxNova/CFileTime.inc:482
  • Documented in DateTime/CFileTime Class.md
  • Topic: CFileTime Class