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

Closed    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 05-17-2017   -   Original Discussion by simpltyansh
simpltyansh simpltyansh is offline
Registered User
 
Join Date: Mar 2014
Last Activity: 6 October 2017, 11:17 AM EDT
Posts: 14
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   -   Original Discussion by simpltyansh
Neo's Unix or Linux Image
Neo Neo is offline Forum Staff  
Administrator
 
Join Date: Sep 2000
Last Activity: 19 November 2017, 1:33 PM EST
Location: Asia pacific region
Posts: 13,908
Thanks: 898
Thanked 1,241 Times in 583 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   -   Original Discussion by simpltyansh
simpltyansh simpltyansh is offline
Registered User
 
Join Date: Mar 2014
Last Activity: 6 October 2017, 11:17 AM EDT
Posts: 14
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   -   Original Discussion by simpltyansh
vgersh99's Unix or Linux Image
vgersh99 vgersh99 is online now Forum Advisor  
Forum Advisor
 
Join Date: Feb 2005
Last Activity: 19 November 2017, 4:21 PM EST
Location: Foxborough, MA
Posts: 8,201
Thanks: 231
Thanked 785 Times in 732 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
Closed

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 01: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 02:16 PM
Need script to generate all the dates in DDMMYY format between 2 dates frozensmilz Shell Programming and Scripting 2 01-29-2009 06:06 AM
How to calculate specific hours between 2 dates sickboy Shell Programming and Scripting 5 07-25-2008 11:35 AM
Difference in day-hours-minutes-seconds format Sreejith_VK Shell Programming and Scripting 7 02-27-2008 02:04 AM



All times are GMT -4. The time now is 05:47 PM.