info.mailtraq.com > Management > Script Functions A-Z > FormatDateTime() FormatDateTime()Creates a formatted output date and time string. The input can be a numerical (datenum) where the integer portion represents the number of days since 1900 and the fraction represents the time of day, or a date and time string (datestring) in a recognised format, for example the RFC2822 datetime stamp produced by the Now() function. If no input is provided, Mailtraq assumes the current date and time.
text := FormatDateTime( format [ , datenum | datestring ] )
- format
- A string employing one of more of the display formats defined below
- datenum
- A number representing date and time. If no date and time is specified Mailtraq assumes the current date and time
- datestring
- A recognised date and time formatted string
- text
- Formatted output date using the locale settings on the host machine
FormatDateTime("dddd, mmm d yyyy 'at' hh:nn", date)
Display Formats
d
| Single digit day number (1-31) |
dd
| Double digit day number (01-31) |
ddd
| Three letter day abbreviation (Sun) |
dddd
| Full length day name (Sunday) |
m
| Single digit month number (1-12) |
mm
| Double digit month number (01-12) |
mmm
| Three letter month abbreviation (Jan) |
mmmm
| Full length month name (January) |
yy
| Two digit year (99) |
yyyy
| Four digit year (1999) |
h
| Single digit hour (0-23) |
hh
| Double digit hour (00-23) |
n
| Single digit minutes (0-59) |
nn
| Double digit minute (00-59) |
s
| Single digit second (0-59) |
ss
| Double digit second (00-59) |
am/pm
| Displays "am" or "pm" using the local settings. The time is converted to 12 hour format |
a/p
| Displays "a" or "p". The time is converted to 12 hour format |
/
| Displays the date separator for the locale |
:
| Displays the time separator for the locale |
'text'
| Text enclosed between single quotes is displayed literally | |