Tools.h++ Manual
104011 Tandem Computers Incorporated 21-137
21
virtual RWBoolean stringToDate(const RWCString&, struct
tm*) const = 0
;
Interprets the
RWCString
as a date, and extracts the month, day, and year
components to the
tm
argument. It returns
TRUE
for a valid date,
FALSE
otherwise. If it returns
FALSE,
the
struct tm
argument is untouched;
otherwise it sets the
tm_mday, tm_mon
, and
tm_year
members. If the date is
entered as three numbers, the order expected is the same as that produced by
strftime()
.
Note – This function cannot reject all invalid date strings.
The following are examples of valid date strings in an English-speaking locale:
"Jan 9, 62" "1/9/62" "January 9 1962"
"09Jan62" "010962"
virtual RWBooleanstringToTime(const RWCString&, struct tm*)
const = 0;
Interprets the
RWCString
argument as a time, with hour, minute, and optional
second. If the hour is in the range [1..12], the local equivalent of “AM” or
“PM” is allowed. Returns
TRUE
for a valid time string,
FALSE
for an error. If
it returns
FALSE
, the tm argument is untouched; otherwise it sets the tm_hour,
tm_min, and tm_sec members. Note that this function cannot reject all invalid
time strings. The following are examples of valid time strings in an English-
speaking locale:
"1:10 AM" "13:45:30" "12.30.45pm"
"PM 3:15" "1430"
x
Date [uses
tm::tm_yday
in some locales]
Feb 29 1984
X
Time
14:34:56
y
Year of the century, from 00
84
Y
Year
1984
Z
Time zone name [from
tm::tm_isdst
]
PST
or
PDT
Table 21-2 (Continued)
Format
character Meaning Example