actually i need to find the time diff..the time values are in 24 hr format....n date n time values are separately defined ..
help me out
regards,
prudhvi.
how to get time difference
-
- Global moderator
- Posts: 3805
- Joined: Tue Jan 25, 2011 12:02 am
- Skillset: Easytrieve Plus, Cobol, Utilities, that sort of stuff
- Referer: Google
Re: how to get time difference
You have chosen section of the forum to ask the question.
Where do you need to know the time difference? Program? Database? What? If you give all the details, you'll be more likely to get a useful answer.
Where do you need to know the time difference? Program? Database? What? If you give all the details, you'll be more likely to get a useful answer.
-
- Global moderator
- Posts: 3720
- Joined: Sat Dec 19, 2009 8:32 pm
- Skillset: Systems programming, SAS, COBOL, CICS, JCL, SMS, VSAM, etc.
- Referer: other forum
- Location: Dubuque, Iowa, USA
Re: how to get time difference
Either you have not explained everything, or you've got a reason not to use your brain? First, decide if you need to result in nanoseconds, or seconds, or minutes, or hours, or whatever. Then, take your first value for seconds and subtract it from your second value for seconds. If you have a negative value, add 60 and subtract 1 from the minutes second value. Repeat for minutes and hours. You wind up with the difference in hours, minutes, and seconds (ignoring the days of course -- but accounting for days does not require a lot more effort, in thinking OR coding, to handle). So why are you not able to develop this algorithm yourself?
-
- Posts: 272
- Joined: Mon Feb 25, 2008 3:53 am
- Skillset: None
- Referer: Google
- Location: Mumbai, India
Re: how to get time difference
n_prudhvi - I've moved your topic to 'IBM Cobol' part of the Foum, though I'm not sure what kind of solution you might be looking for - but it did not belong to "suggestion & feedback" part of the forum for sure.
Anuj
-
- Similar Topics
- Replies
- Views
- Last post
-
- 3
- 2687
-
by engh
View the latest post
Mon Jan 09, 2023 2:23 pm
-
- 3
- 1789
-
by Blackthorn
View the latest post
Fri Mar 05, 2021 9:34 pm