Custom Web Publishing Guide

Table Of Contents
72 FileMaker Server Advanced Custom Web Publishing Guide
Using the date, time, and day extension functions
You can use extension functions to get the current date, time, or day, and to compare any two dates, times,
or days.
The functions in the following table use the “fm” formats regardless of locale. The “fm” formats are MM/
dd/yyyy
for date, HH:mm:ss for time, and MM/dd/yyyy HH:mm:ss for timestamp.
To re-arrange output values into a different or preferred format, use calculation functions or JavaScript.
Date, time, day extension function
Data type
returned Description
fmxslt:get_date() string Returns the current date in the “fm” format.
fmxslt:get_date(String format) string Returns the current date in the format you specify.
Enter the string “short”, “long”, or “fm” for the
format parameter.
fmxslt:get_time() string Returns the current time in the “fm” format.
fmxslt:get_time(String format) string Returns the current time in the format you specify.
Enter the string “short”, “long”, or “fm” for the
format parameter.
fmxslt:get_day() string Returns the current day in the short format.
fmxslt:get_day(String format) string Returns the current day in the format you specify.
Enter the string “short” or “long” for the format
parameter.
fmxslt:get_fm_date_format() string Returns the formatting string for “fm” date format:
MM/dd/yyyy
fmxslt:get_short_date_format() string Returns the formatting string for short date format:
M/d/yy
fmxslt:get_long_date_format() string Returns the formatting string for long date format:
MMM d, yyyy
fmxslt:get_fm_time_format() string Returns the formatting string for “fm” time format:
HH:mm:ss
fmxslt:get_short_time_format() string Returns the formatting string for short time format:
h:mm a
fmxslt:get_long_time_format() string Returns the formatting string for long time format:
h:mm:ss a z
fmxslt:get_short_day_format() string Returns the formatting string for short day format:
EEE
fmxslt:get_long_day_format() string Returns the formatting string for long day format:
EEEE
fmxslt:compare_date(String date1,
String date2)
number This function compares two date values. It returns a
negative number if date1 is before date2. It returns a
positive number if
date1 is after date2. It returns a 0 if
date1 is identical to date2. Both dates must be
specified in the “fm” date format.