cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
trouble with coding time/ date
trouble with coding time/ date
Aug 7, 2012 at 10:56pm UTC
qwerty123
(2)
i am trying to write up the code for 31/01/2012 at 23:58 so that if you add 1 second it would change to 59 and if you add 2 seconds to it it would change to 1/02/2012 00:00. help would be much appreciated
Aug 7, 2012 at 11:13pm UTC
Disch
(13742)
Add the minutes. If you have more than 60 minutes, subtract 60 and add 1 hour. If you have more than 24 hours, subtract 24 and add 1 day.
etc, etc.
Aug 7, 2012 at 11:20pm UTC
qwerty123
(2)
how would i be able to write this in code though?
Aug 7, 2012 at 11:24pm UTC
Disch
(13742)
I'm not going to do the work for you, but it should be very easy to translate what I just wrote in my above post to actual C++ code.
Topic archived. No new replies allowed.