Help Center

CPowerTime.Formatmethod

Converts a **CPowerTime** object to a string.

DateTimemethoddocumented

Syntax

FUNCTION Format (BYREF wszFmt AS WSTRING) AS DWSTRING

Description

Converts a CPowerTime 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 CPowerTime cft = AfxLocalFileTime print cft.Format("%A, %B %d, %Y %H:%M:%S")

Reference

  • Defined in AfxNova/CPowerTime.inc:958
  • Documented in DateTime/CPowerTime Class.md
  • Topic: CPowerTime Class