Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 help with adding time
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
kidd




PostPosted: 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
Sponsor
Sponsor
Sponsor
sponsor
ericfourfour




PostPosted: 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.
BigBear




PostPosted: 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
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: