ftime()
Function usage:
ftime(format, time)
Returns a string formatted from a system time time (obtained from
time()) according to
format.
If format is "@", a raw system time (e.g., seconds since 1970-01-01
00:00:00 UTC) will be displayed.
Otherwise, each "%" in format describes a conversion:
- %@
- raw system time (nonstandard TF extension)
- %a
- abbreviated weekday name
- %A
- full weekday name
- %b
- abbreviated month name
- %B
- full month name
- %c
- local time and date
representation
- %d
- day of month (01-31)
- %H
- hour on 24-hour clock (00-23)
- %I
- hour on 12-hour clock (01-12)
- %j
- day of year (001-366)
- %m
- month (01-12)
- %M
- minute (00-59)
- %p
- local equivalent of "AM" or "PM"
- %S
- second (00-61)
- %U
- week number of year, Sunday is first day of week (00-53)
- %w
- weekeday (0-6, Sunday is 0)
- %W
- week number of year, Monday is first day of week (00-53)
- %x
- local date representation
- %X
- local time representation
- %y
- year without century (00-99)
- %Y
- year with century
- %Z
- time zone name, if any
- %%
- "%"
Names and conversions labeled "local" may be affected by the
setting of the LC_TIME locale category.
Additional "%" conversions may be supported by your system; see your system's
strftime() documentation for details.
All other characters in format are copied unmodified to the result.
Example:
command: /expr
ftime("Today is %a %b %d",
time())
output: Today is Thu Jul 02
See:
functions,
time(),
locale,
%TZ.
%time_format
Back to index
Back to tf home page
Copyright © 1998 - 1999 Ken Keys