![]() |
|
|
|||||||
| Home | Forums | Register | Rules & FAQ | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| HP-UX HP-UX (Hewlett Packard UniX) is Hewlett-Packard's proprietary implementation of the Unix operating system, based on System V. |
Other UNIX.COM Threads You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| help with while loop or any other alternative? | filthymonk | Shell Programming and Scripting | 3 | 04-17-2008 11:19 PM |
| Alternative of format date in HP unix | epall | UNIX for Dummies Questions & Answers | 2 | 09-29-2007 10:56 PM |
| Using awk (or an alternative) | michaeltravisuk | Shell Programming and Scripting | 5 | 03-08-2007 07:37 PM |
| .NET Alternative | goon12 | UNIX for Dummies Questions & Answers | 3 | 04-06-2005 09:07 AM |
| cut -f (or awk alternative) | gefa | Shell Programming and Scripting | 6 | 03-02-2005 09:26 AM |
![]() |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
Alternative to date +%s
Hi,
My version of HP-UX does not support "date +%s" to find the number of seconds elapsed since 01/01/1970. It would be great if anyone can give some simpler ideas for achieving the same. Thanks. |
| Forum Sponsor | ||
|
|
|
|||
|
You could try installing GNU's date command. It has a %s option and some other really cool features that once you install you'll want to keep forever. To get it, install GNU's coreutils on a test server and then copy just the date command over. I usually rename it to gdate so that HP's date program is still intact.
|
|
|||
|
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. |
|||
| Google UNIX.COM |