ascftime man page on IRIX

Man page or keyword search:  
man Server   31559 pages
apropos Keyword Search (all sections)
Output format
IRIX logo
[printable version]



strftime(3C)							  strftime(3C)

NAME
     strftime, cftime, ascftime - convert date and time to string

SYNOPSIS
     #include <time.h>

     size_t strftime (char *s, size_t maxsize, const char *format,
	 const struct tm *timeptr);

     int cftime (char *s, char *format, const time_t *clock);

     int ascftime (char *s, const char *format, const struct tm
	 *timeptr);

DESCRIPTION
     strftime, ascftime, and cftime place characters into the array pointed to
     by s as controlled by the string pointed to by format.  The format string
     consists of zero or more directives and ordinary characters.  All
     ordinary characters (including the terminating null character) are copied
     unchanged into the array.	For strftime, no more than maxsize characters
     are placed into the array.

     If format is (char *)0, then the locale's default format is used.	For
     strftime the default format is the same as "%KC", for cftime and ascftime
     the default format is the same as "%KC".  cftime and ascftime first try
     to use the value of the environment variable CFTIME, and if that is
     undefined or empty, the default format is used.

     Each directive is replaced by appropriate characters as described in the
     following list.  The appropriate characters are determined by the LC_TIME
     category of the program's locale and by the values contained in the
     structure pointed to by timeptr for strftime and ascftime, and by the
     time represented by clock for cftime.

     %%	       same as %
     %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
     %C	       century number (the year divided by 100 and truncated to an
	       integer) as a decimal number [00-99]
     %d	       day of month ( 01 - 31 )
     %D	       date as %m/%d/%y
     %e	       day of month (1-31; single digits are preceded by a blank)
     %F	       equivalent to the "%Y-%m-%d" ISO 8601 date format.
     %g	       The year within the century based on the ISO 8601 week.	This
	       is a decimal ranging from '00' to '99'.	See '%V' for
	       information on the ISO 8601 week.
     %G	       The year based on the ISO 8601 week.  This is a four digit
	       decimal number.	See '%V' for information on the ISO 8601 week.

									Page 1

strftime(3C)							  strftime(3C)

     %h	       locale's abbreviated month name.
     %H	       hour ( 00 - 23 )
     %I	       hour ( 01 - 12 )
     %j	       day number of year ( 001 - 366 )
     %KC       locale's appropriate date and time representation
     %m	       month number ( 01 - 12 )
     %M	       minute ( 00 - 59 )
     %n	       same as new-line
     %p	       locale's equivalent of either AM or PM
     %r	       locale's 12-hour time representation, default %I:%M:%S [AM|PM]
     %R	       time as %H:%M
     %S	       seconds ( 00 - 61 ), allows for leap seconds
     %t	       same as a tab
     %T	       time as %H:%M:%S
     %U	       week number of year ( 00 - 53 ), Sunday is the first day of
	       week 1
     %V	       The ISO 8601:1988 week number.  The replacement is a decimal
	       number ranging from '00' to '53'.  Each ISO 8601:1988 week
	       starts on Monday and the first week of the year is the week
	       which has a majority of its days in that year.  Note that the
	       first or last week of the year may or may not have all of its
	       days fall into its respective year.  The first week of the
	       current year may begin in the previous year or the last week of
	       the previous year may end in the current year.
     %w	       weekday number ( 0 - 6 ), Sunday = 0
     %W	       week number of year ( 00 - 53 ), Monday is the first day of
	       week 1
     %x	       locale's appropriate date representation
     %X	       locale's appropriate time representation
     %y	       year within century ( 00 - 99 )
     %Y	       year as ccyy ( e.g. 1986)
     %Z	       time zone name or no characters if no time zone exists

     The difference between %U and %W lies in which day is counted as the
     first of the week.	 Week number 01 is the first week in January starting
     with a Sunday for %U or a Monday for %W.  Week number 00 contains those
     days before the first Sunday or Monday in January for %U and %W,
     respectively.

     strftime, cftime, and ascftime return the number of characters placed
     into the array pointed to by s not including the terminating null
     character.	 (If more than maxsize characters would have been placed into
     the array, strftime returns zero and the array content is indeterminate.
     If strftime, cftime, or ascftime overrun the size of the array, the
     behavior is undefined.)

   Selecting the Output's Language
     By default, the output of strftime, cftime, and ascftime appear in U.S.
     English.  The user can request that the output of strftime, cftime, or
     ascftime be in a specific language by setting the locale for category
     LC_TIME in setlocale.

									Page 2

strftime(3C)							  strftime(3C)

   Timezone
     The timezone is taken from the environment variable TZ [see ctime(3C) for
     a description of TZ].

EXAMPLES
     The example illustrates the use of strftime.  It shows what the string in
     str would look like if the structure pointed to by tmptr contains the
     values corresponding to Thursday, August 28, 1986 at 12:44:36 in New
     Jersey.
	       strftime (str, strsize, "%A %b %d %j", tmptr)
     This results in str containing "Thursday Aug 28 240".

FILES
     /usr/lib/locale/locale/LC_TIME - file containing locale-specific date and
     time information

SEE ALSO
     time(2), ctime(3C), getenv(3C), setlocale(3C), strftime(4), timezone(4),
     environ(5).

NOTE
     cftime and ascftime are obsolete.	strftime should be used instead.

									Page 3

[top]

List of man pages available for IRIX

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net