Topic : An introduction to C
Author : Tom Torfs
Page : << Previous 26  
Go to page :


the output doesn't fit in maxsize characters, in that case 0 is returned.
Again, the % character indicates a format specifier, so to print a % sign, you must use %%. The following format specifiers are supported:

%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 the month as a decimal number [01..31]
%H  hour (24-hour clock) as a decimal number [00..23]
%I  hour (12-hour clock) as a decimal number [01..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]
%p  locale's equivalent of AM/PM
%S  second as a decimal number [00..60]
%U  week number of the year (the first Sunday as the first day
    of week 1) as a decimal number [00..53]
%w  weekday (where Sunday is 0) as a decimal number [0..6]
%W  week number of the year (the first Monday as the first day
    of week 1) as a decimal number [00..53]
%x  locale's appropriate date representation
%X  locale's appropriate time representation
%y  last 2 digits of the year as a decimal number [00..99]
%Y  whole year as a decimal number (e.g. 1998)
%Z  timezone name or abbreviation, or no characters if the
    timezone can't be determined


time_t time(time_t *timer);

Returns the current calendar time as an encoded time_t value. If timer is not NULL, the value will be stored in the time_t pointed to by timer as well.17. Epilogue
17.1. Credits
Thanks to the following people for providing useful suggestions, corrections, additions: (in alphabetical order by surname)

Nick Austin
Aaron Crane
Dann Corbit
Lawrence Kirby
Bernd Luevelsmeyer
Tom Nolette
Sunil Rao
Robin Sheppard
Jan Schuhr
David Tait
George White


17.2. Other interesting C-related online material
The comp.lang.c answers to frequently asked questions:

http://www.eskimo.com/~scs/C-faq/top.html
Bob Stout's Snippets collection:
http://www.snippets.org/
Dinkumware's C reference:
http://www.dinkumware.com/refxc.html
Overview of reserved identifiers:
http://www.mindspring.com/~brahms/c-predef.htm
Links to other C resources:
http://www.lysator.liu.se/c/


Page : << Previous 26