HP-UX Reference (11i v2 07/12) - 3 Library Functions N-Z (vol 7)

s
strptime(3C) strptime(3C)
NAME
strptime() - date and time conversion
SYNOPSIS
#include <time.h>
char *strptime(const char *buf, const char *format, struct tm *tm);
DESCRIPTION
The strptime() function converts the character string pointed to by buf to values which are stored in
the
tm structure pointed to by tm, using the format specified by format.
The format is composed of zero or more directives. Each directive is composed of one of the following: one
or more whitespace characters (as specified by the
isspace() function); an ordinary character (neither
% nor a whitespace character); or a conversion specification. Each conversion specification is composed of a
% character followed by a conversion character which specifies the replacement required. There must be
whitespace or other non-alphanumeric characters between any two conversion specifications. The following
conversion specifications are supported:
%a is the day of week, using the locale’s weekday names; either the abbreviated or full name may be
specified.
%A is the same as %a.
%b is the month, using the locale’s month names; either the abbreviated or full name may be
specified.
%B is the same as %b.
%c is the date and time, using locale’s date and time format (for example, as
%x %X).
%C is the century number [0,99]; leading zeros are permitted but not required.
%d is the day of month [1,31]; leading zeros are permitted but not required.
%D is the date as %m/%d/%y.
%e is the same as %d.
%h is the same as %b.
%H is the hour (24-hour clock) [0,23]; leading zeros are permitted but not required.
%I is the hour (12-hour clock) [1,12]; leading zeros are permitted but not required.
%j is the day number of the year [1,366]; leading zeros are permitted but not required.
%m is the month number [1,12]; leading zeros are permitted but not required.
%M is the minute [0,59]; leading zeros are permitted but not required.
%n is any whitespace.
%p is the locales equivalent of a.m or p.m.
%r is the time as %I:%M:%S %p.
%R is the time as %H:%M.
%S is the seconds [0,61]; leading zeros are permitted but not required.
%t is any whitespace.
%T is the time as %H:%M:%S.
%U is the week number of the year (Sunday as the first day of the week) as a decimal number [0,53];
leading zeros are permitted but not required. All days in a year preceding the first Sunday are
considered to be in week 0.
%w is the weekday as a decimal number [0,6], with 0 representing Sunday; leading zeros are permit-
ted but not required.
%W is the week number of the year (Monday as the first day of the week) as a decimal number [0,53];
leading zeros are permitted but not required. All days in a year preceding the first Monday are
considered to be in week 0.
HP-UX 11i Version 2: December 2007 Update 1 Hewlett-Packard Company 463