> --- "Todd C. Johnson" wrote:
> I am trying to create a new record with default
> date and start time.
> ...
> typedef struct
> {
> DateType date; // Date of service perid
> ...
> } ServDBRecord;
> ...
> ServDBRecord record;
> DateTimeType now;
>
> // Get current date for new Service Period
> TimSecondsToDateTime(TimGetSeconds(), &now);
now.year will be 2001
> record.date.year = now.year;
record.date.year (a DateType) stores the number of
years since 1904 (it only has 7 bits). So you need to
use
record.date.year = now.year - 1904;
2001 - 1904 is 97, which takes 7 bits, and is OK.
2001 requires 11 bits - not OK. Note that any system
that uses the original Macintosh date format will
suffer from the Y2K+32 problem.
__________________________________________________
Do You Yahoo!?
Check out Yahoo! Shopping and Yahoo! Auctions for all of
your unique holiday gifts! Buy at http://shopping.yahoo.com
or bid at http://auctions.yahoo.com
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/