Formatting functions




uFormatDate

Description

The function uFormatDate returns a user-defined string with date information. Special escape sequences in the format string will be replaced by the referring date part.

The following table shows the format identifiers.

Table 7-2: Format identifiers

Identifier

Date part

%A

Weekday name

%a

Weekday name short

%B

Month name

%b

Month name short

%d

Day of month

%f

Fractional seconds SS.SSS

%H

Hour 00-24

%j

Day of year 000-366

%J

Julian day number

%m

Month

%M

Minute

%s

Seconds since 1970-01-01

%S

Seconds 00-59

%w

Day of week 0-6, 0=Sunday

%W

Week of year

%Y

Year 0000-9999

%%

%

NoteRefer to the “Working with Dates and Times” section for detailed information about the possible modifier arguments.

Syntax

number uFormatDate(format, modifiers, ...)

Examples

Example 1

To create a string from a date:

uFormatDate("Today is %A the %d of %B in %Y", "now")  // returns something like "Today is Thursday the 10 of February in 2005"