Computer Science Canada

help with adding time

Author:  kidd [ Wed Feb 06, 2008 12:47 pm ]
Post subject:  help with adding time

Well I need help with adding my time i gotta add and subtract 2 times (02-06-08 00:31 + 00-00-01 06:00)(02-06-09 00:31 - 00-00-00 06:00)
can any one help me with this? what it should = is 02-06-09 00:06:31

Author:  ericfourfour [ Wed Feb 06, 2008 2:30 pm ]
Post subject:  Re: help with adding time

You need two functions: one that converts seconds to a date and another that converts a date to seconds. Turing has these functions. Time.SecDate converts seconds to a date string. Time.DateSec converts a date string into seconds.

Do the math with the date in seconds. Do the displaying with the date as a string.

Author:  BigBear [ Wed Feb 06, 2008 2:55 pm ]
Post subject:  Re: help with adding time

I was wondering how to just display date and time. Whenever I even run the sample programs it doesn't run or says wrong stuff


: