Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The following procedure shows how to format time values.
To format a string representation of a time or elapsed time
Use the Format member function from either the CTime or CTimeSpan classes to create a character string representation of the time or elapsed time, as shown by the following example.
CTime t( 1991, 3, 19, 22, 15, 0 ); // 10:15PM March 19, 1991 CString s = t.Format( "%A, %B %d, %Y" ); // s == "Tuesday, March 19, 1991"