The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > HP-UX
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #5 (permalink)  
Old 03-26-2008
Data469 Data469 is offline
Registered User
 

Join Date: Feb 2008
Posts: 7
I use HP-UX and it does not support "date +%s".

My basic requirement is that I need to find the difference (number of days) between two dates. My idea was to convert the dates to seconds. date +%s -d <date> gives the number of seconds elapsed since 01/01/1970 to the current date. Thus I can get both the dates in seconds & then find difference and then convert it back to days.

But the problem here that as I said earlier, HP-UX does not support date +%s. And I need this to be strictly in ksh and not in perl.

Any help on this will be highly appreciated.

Thanks.
Reply With Quote