I think you were closer with your second attempt, you just need to tell the compiler to use 32-bit integers.
gExpiry = TimGetSeconds() + 30 * daysInSeconds; Matt ----- Original Message ----- From: "David Martin" <[EMAIL PROTECTED]> To: "Palm Developer Forum" <[EMAIL PROTECTED]> Sent: Thursday, April 03, 2003 4:11 AM Subject: RE: how to change time and date values > Thank you, miracle recovery! > > I'll include the corrections so the next hunt through the archives will > be rewarded: > > /* add 30 days to current time */ > UInt32 timenow = TimGetSeconds(); > UInt32 gExpiry; > > TimSecondsToDateTime( timenow, &dt_expiry ); > DateSecondsToDate( timenow, &d_expiry ); > DateAdjust( &d_expiry, 30 ); > dt_expiry.year = d_expiry.year + 1904; > dt_expiry.month = d_expiry.month; > dt_expiry.day = d_expiry.day; > gExpiry = TimDateTimeToSeconds( &dt_expiry ); > > > David M > > > > -----Original Message----- > > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED] On > > Behalf Of Aaron Ardiri > > Sent: Wednesday, April 02, 2003 9:54 AM > > To: Palm Developer Forum > > Subject: Re: how to change time and date values > > > > > > > DateTimeType *dt_expiry; > > > DateType *d_expiry; > > > > these should be: > > > > DateTimeType dt_expiry; > > DateType d_expiry; > > > > > UInt32 gExpiry; > > > > > > /* first attempt: bus error (read from non-mapped memory)*/ > > > TimSecondsToDateTime( timenow, dt_expiry ); DateSecondsToDate( > > > timenow, d_expiry ); > > > > and.. > > > > TimSecondsToDateTime( timenow, &dt_expiry ); > > DateSecondsToDate( timenow, &d_expiry ); > > > > > > you should be able to figure out what is wrong from that. > > > > --- > > Aaron Ardiri [EMAIL PROTECTED] > > CEO - CTO +46 70 656 1143 > > Mobile Wizardry http://www.mobilewizardry.com/ > > > > -- > > For information on using the Palm Developer Forums, or to > > unsubscribe, please see http://www.palmos.com/dev/support/forums/ > > > > > -- > For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/ > > -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
