![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Search attributes in one structure using the values from another structure | dhanamurthy | High Level Programming | 3 | 03-27-2008 12:37 AM |
| conversion of unix time format | sari | Windows & DOS: Issues & Discussions | 2 | 03-02-2008 11:33 PM |
| conversion from EPOCH timestamp to local time zone | abhijeetkul | Shell Programming and Scripting | 2 | 02-17-2006 03:19 AM |
| Copying a Directory Structure to a new structure | jhansrod | UNIX for Dummies Questions & Answers | 8 | 07-27-2005 03:24 AM |
| Time conversion in Unix | kamlakar | UNIX for Advanced & Expert Users | 1 | 04-22-2002 09:55 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Conversion of time structure in C++
Hi frnds,
I have written a code to get current time struct tm *locTime; time_t currentTime; time( ¤tTime ); locTime = localtime(¤tTime ); Suppose now i get output time as 31-DEC-2007 00:00:00 What i want now is i want two strings where in one string i want to subtract time to 2 hours that is one string should have value as 30-DEC-2007 22:00:00 and other string should have value 26 hours less that is 23-DEC-2007 22:00:00 I tried some cases where in i subtracted value but it was not working.Is there a way out for this |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
subtract/add to the current time.
i.e 2 before current time is preTime = currTime - 2*60*60; |
|||
| Google The UNIX and Linux Forums |