DADiSP Worksheet Functions > Function Categories > File Manipulation > STRFTIME

 

STRFTIME

Purpose:

Converts a file time value to a string.

Syntax:

STRFTIME("format", timeval)

"format"

-

Optional. A string, the format. Defaults to "%c":

 

 

"%a"

Locale's abbreviated weekday name.

"%A"

Locale's full weekday name.

"%b"

Locale's abbreviated month name.

"%B"

Locale's full month name.

"%c"

Locale's appropriate date and time representation.

"%d"

Day of month as a decimal number (01-31).

"%D"

Date in the format mm/dd/yy.

"%h"

Locale's abbreviated month name.

"%H"

Hour (24 hour clock) as a decimal number (00-23).

"%I"

Hour (12 hour clock) as a decimal number (00-12).

"%j"

Day of the year as a decimal number (001-366).

"%m"

Month as a decimal number (01-12).

"%M"

Minute as a decimal number (00-59).

"%n"

Newline character.

"%p"

Locale's equivalent of either AM or PM.

"%r"

12 hour clock time (01-12) using AM/PM notation in the format HH:MM:SS (AM/PM).

"%S"

Seconds as a decimal number (00-59).

"%t"

Tab character.

"%T"

24 hour clock time in the format HH:MM:SS.

"%U"

Week number of the year as a decimal number (00-52) where Sunday is the first day of the week.

"%w"

Weekday as a decimal number (0-6) where 0 is Sunday.

"%W"

Week number of the year as decimal number (00-52) where Monday is the first day of the week.

"%x"

Locale's appropriate date representation.

"%X"

Locale's appropriate time representation.

"%y"

Year without century as a decimal number (00-99).

"%Y"

Year with century as a decimal number.

"%Z"

Timezone name or no characters if no timezone.

"%%"

The % character.

timeval

-

Optional. An integer. Time value as returned by the FSTAT function. Defaults to the current time.

Returns:

Time value formatted as a string.

Example:

strftime

 

returns the current time in the following form:

Fri Oct 12 21:00:18 2030

 

strftime("%D", fstat("myfile", 10))

 

returns the modified time of myfile in mm/dd/yy form:

10/12/30

See Also:

FSTAT