time_stamp |
Top Previous Next |
Scripts > Class elements and c++ instructions > Other functions > time_stamp Prototype
str time_stamp() str time_stamp(const str& xsFormat)
Description
Converts the present date and time into a string. If the function is called without parameter or with an empty string, then the resulting string contains 26 characters in the following format:
Mon Nov 21 11:31:54 1983\n
To get another format, the function can be called with a format string. This string is a combination of normal text and formatting characters followed on "%". The possible formatting characters are listed in the following table:
Only those parts that are actually used are noted
Return value
A string with date and time
Examples
out << time_stamp() << endl; out << time_stamp("It is %M minutes after %I o'clock (%Z) %A, %B %d %Y") << endl; out << time_stamp("It is %M minutes after %I o'clock (%Z)") << endl; out << time_stamp("%A, %B %d %Y") << endl;
results in:
Tue Oct 23 00:34:51 2007
It is 34 minutes after 12 o'clock () Tuesday, October 23 2007 It is 34 minutes after 12 o'clock () Tuesday, October 23 2007
when writing this help section.
|
This page belongs to the TextTransformer Documentation |
Home Content German |