Unix/Linux Go Back    


Shell Programming and Scripting BSD, Linux, and UNIX shell scripting — Post awk, bash, csh, ksh, perl, php, python, sed, sh, shell scripts, and other shell scripting languages questions here.

Find hours difference between two dates in given format

Shell Programming and Scripting


Tags
solved

Reply    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 05-17-2017
simpltyansh simpltyansh is offline
Registered User
 
Join Date: Mar 2014
Last Activity: 8 June 2017, 7:46 AM EDT
Posts: 12
Thanks: 9
Thanked 0 Times in 0 Posts
Unix or Linux Question Find hours difference between two dates in given format

I have two dates in below format, how would I find the hours difference between the two dates. Im using AIX and ksh.


Code:
Current date : Wed May 17 14:34:41 SGT 2017
File date    : Thu Apr 27 20:52:41 SGT 2017

Sponsored Links
    #2  
Old Unix and Linux 05-17-2017
Neo's Unix or Linux Image
Neo Neo is offline Forum Staff  
Administrator
 
Join Date: Sep 2000
Last Activity: 23 July 2017, 11:43 AM EDT
Location: Asia pacific region
Posts: 13,586
Thanks: 853
Thanked 1,142 Times in 535 Posts
Hi.

Our forum rules are that you should search the forums before posting a question:

If you search the forums for "find the hours difference between the two dates" you will find many posts at unix.com related to this question.
Sponsored Links
    #3  
Old Unix and Linux 05-17-2017
simpltyansh simpltyansh is offline
Registered User
 
Join Date: Mar 2014
Last Activity: 8 June 2017, 7:46 AM EDT
Posts: 12
Thanks: 9
Thanked 0 Times in 0 Posts
Unix or Linux Question

I checked it already, but couldn't find the appropriate answer to it.
Could I please find an answer to this ?
    #4  
Old Unix and Linux 05-17-2017
vgersh99's Unix or Linux Image
vgersh99 vgersh99 is offline Forum Advisor  
Forum Advisor
 
Join Date: Feb 2005
Last Activity: 23 July 2017, 11:40 AM EDT
Location: Foxborough, MA
Posts: 8,178
Thanks: 220
Thanked 778 Times in 728 Posts
Quote:
Originally Posted by simpltyansh View Post
I checked it already, but couldn't find the appropriate answer to it.
Could I please find an answer to this ?
How about looking at the bottom of this thread for the section/table labled: "More UNIX and Linux Forum Topics You Might Find Helpful" - there're plenty of related threads.
Sponsored Links
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to get ALL update dates and hours of a file? nurinolo UNIX for Advanced & Expert Users 3 04-10-2014 12:59 PM
Date difference between 2 dates in 'yyyy-mm-dd hh:mm:ss' format muay_tb Shell Programming and Scripting 4 04-07-2009 01:16 PM
Need script to generate all the dates in DDMMYY format between 2 dates frozensmilz Shell Programming and Scripting 2 01-29-2009 05:06 AM
How to calculate specific hours between 2 dates sickboy Shell Programming and Scripting 5 07-25-2008 10:35 AM
Difference in day-hours-minutes-seconds format Sreejith_VK Shell Programming and Scripting 7 02-27-2008 01:04 AM



All times are GMT -4. The time now is 12:52 PM.