DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
No more ctime(3C) errors - Time(3C++)

Component extractors

The component extractors can be used to view the individual components of a Time, which will (of course) be normalized values. For example:

       Time t = Time::julian(1987,632) - Duration::hours(12);
       cout << t.month_part() << "/"
            << t.day_part() << "/"
            << t.year_part() << " "
            << t.clock_part() << endl;

prints:

       8/22/1988 0d 12h 00m 00s
Since there were 365 days in 1987, day 632 of 1987 is normalized to day 267 of 1988, which was September 23; however normalizing the Duration (- 12h) changes the Time to noon on September 22.

Note that all component extractors come in two forms: one with and one without a Place parameter. The ones without a Place parameter assume the host machine location.


Next topic: Day-of-week operations
Previous topic: Julian date operations

© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 27 April 2004