Format: strptime( string, format, time )

Purpose: Parse a string-formatted time value. The string and format parameter must denote a string. The time parameter must be a value to which an object containing the broken down time can be assigned. The structure of a broken down time object is described in localtime().

Return Values: Returns null if string cannot be parsed using format. Otherwise, it returns the position after the last character within string that has been parsed.

The format string consists of zero or more conversion specifications and ordinary characters. A conversion specification consists of a '%' (percent) character followed by a character that determines the specification's behavior. Ordinary characters are copied unchanged into the result string. Each conversion specification is replaced by appropriate characters as described in the following list.

%%percent character
%aabbreviated weekday name
%Afull weekday name
%babbreviated month name
%Bfull month name
%cdefault date and time representation (same as %x %X)
%dday of month, two digits 01-31
%Hhour, two digits 00-23
%Ihour, two digits 01-12
%jday of the year, three digits 001-366
%mmonth number, two digits 01,12
%Mminute, two digits 00-59
%pa.m. or p.m. designation of the 12-hour clock
%rtime as %I:%M:%S %p
%Rtime as %H:%M
%Ssecond, two digits 00-61.
%Ttime as %H:%M:%S
%wweekday number, 0-6, Sunday is 0
%xdefault date representation
%Xdefault time representation
%yyear within century, two digits 00-99
%Yyear with century

Note: In principle, this function does not initialize the time parameter but only stores the values specified. But since we don't know beforehand whether daylight saving time (DST) is in effect or not, the time object's isdst field is set to -1 for heitml versions > 2.05.


input:resulting output:
<? strptime ("Tuesday Feb 29 2000", "%A %b %d %Y", tm) "NN"; ? tm>19(sec=0, min=0, hour=0, mday=29, mon=1, year=2000, wday=2, yday=59, isdst=-1)
<? strptime ("02/29/2000", "%m/%d/%Y", tm) "NN"; ? tm>10(sec=0, min=0, hour=0, mday=29, mon=1, year=2000, wday=2, yday=59, isdst=-1)
<? strptime ("13/33/2002", "%m/%d/%Y", tm) "NN"; ? tm>NULL(sec=0, min=0, hour=0, mday=0, mon=0, year=1900, wday=0, yday=0, isdst=-1)

Note: Internationalization support is planned for the next major revision of heitml.

See Also: caltime(), difftime(), gmtime(), localtime() mktime(), strftime().

This page was dynamically generated by the web application development tool RADpage of H.E.I.
© 1996-2018 H.E.I. All Rights Reserved.

Component Guide
  Language Guide
  Language Ref.
    General Design
    Lexical Structure
    heitml Tags
    heitml Functions
    Advanced Functions
    Database Access
    Global Variables
    Form Fields
    Server Variables
    heitml Syntax
  Component Ref.
  Class Library
  User Components
  Tryout Form
  New Features
  heitml 1
User Guide
Discussion Group