FormatDate - Maple Help

# Online Help

###### All Products    Maple    MapleSim

Finance

 FormatDate
 return a string containing a formatted date

 Calling Sequence FormatDate(data, format)

Parameters

 data - record; date information format - record, list, or a string; (optional) date format

Description

 • The FormatDate command formats the date according to the formatting specification given by the string format. The date format can be any format specification as described in StringTools[ParseTime]. If the original date is given as a string, the corresponding date format will be deduced.

Examples

 > $\mathrm{with}\left(\mathrm{Finance}\right):$
 > $\mathrm{FormatDate}\left("Jan-02-2006","%D"\right)$
 ${"01/02/06"}$ (1)
 > $\mathrm{FormatDate}\left("Jan-02-2006",\mathrm{default}\right)$
 ${"January 2, 2006"}$ (2)
 > $\mathrm{FormatDate}\left("Jan-02-2006",\mathrm{list}\right)$
 $\left[{2}{,}{1}{,}{2006}\right]$ (3)
 > $\mathrm{FormatDate}\left("Jan-02-2006","%Y-%m"\right)$
 ${"2006-01"}$ (4)
 > $\mathrm{FormatDate}\left("Jan-02-2006","%d:%m:%y"\right)$
 ${"02:01:06"}$ (5)

Compatibility

 • The Finance[FormatDate] command was introduced in Maple 15.
 • For more information on Maple 15 changes, see Updates in Maple 15.

 See Also