> -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Saturday, October 11, 2003 10:19 PM > To: [EMAIL PROTECTED] > Subject: RE: working on time > > > It's fair enough to use 86,400 sec in a day. But what about > adding days or
Adding days is simply adding multiples of 86400, 1 for each day, to the epoch time, then converting to m/d/y format using any routine you like. > months? Months are trickier, because of the different number of days in each month. Using the POSIX strftime routines may work better in this case, because you can add a number to a month which may make it out of range, yet the mktime routine will do the correct thing, that is, go to the next year and reset the month to zero, if needed. The Perl routines do range checking. However, with mktime, if you add 1 month to 10/31, you will get 12/1, since 11/31 is not a valid day, so mktime isn't perfect, you would need your program to define the behavior in this case. -Mark -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]