FormatDate()
Syntax
Text$ = FormatDate(Mask$, Date)Description
Returns a string representation of the Date, according to the specified Mask$. The Mask$ parameter is a string which specifies how the date should be formatted. The Mask$ parameter accepts several reserved tokens:%yyyy: Will be replaced by the year value, on 4 digits. %yy: Will be replaced by the year value, on 2 digits. %mm: Will be replaced by the month value, on 2 digits. %dd: Will be replaced by the day value, on 2 digits. %hh: Will be replaced by the hour value, on 2 digits. %ii: Will be replaced by the minute value, on 2 digits. %ss: Will be replaced by the second value, on 2 digits.Example:
Debug FormatDate("Y=%yyyy, M= %mm, D=%dd", Date()) ; Will display the actual date with ; the form "Y=2010, M=01, D=07" Debug FormatDate("%mm/%dd/%yyyy", Date()) ; Will display the actual date with ; the form "01/07/2010" Debug FormatDate("%hh:%ii:%ss", Date()) ; Will display the time using the 00:00:00 formatNote: supported date/time values are 1970-01-01, 00:00:00 for minimum and 2038-01-19, 03:14:07 for maximum.
Supported OS
All