Professional Documents
Culture Documents
html
DateTimeFormat Date/Time
- converts datetime to string (AFL 4.20)
RETURNS STRING
The formatstr argument contains formatting string that specifies how date time
should be converted to string.
1 of 2 7/19/2021, 11:09 PM
AFL Function Reference - DATETIMEFORMAT http://www.amibroker.com/guide/afl/datetimeformat.html
%% - Percent sign
Extra # 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).
EXAMPLE // For example to get full week day name of date time use
str = DateTimeFormat( "%A", dt );
References:
The DateTimeFormat function is used in the following formulas in AFL on-line library:
More information:
2 of 2 7/19/2021, 11:09 PM