comparing dates
anyone know an easy way to compare dates and display the difference? difference doesnt have to be in date format, in fact it would be even easier if it was just one unit, like "total diff in seconds" or nanoseconds or whatever, doesnt matter.
* urgrue <[email protected]> wrote on 10/Oct/2003 - 11:54:08 :
Quoted 4 lines
anyone know an easy way to compare dates and display the difference? difference doesnt have to be in date format, in fact it would be even easier if it was just one unit, like "total diff in seconds" or nanoseconds or whatever, doesnt matter.
If you are comfortable with Perl you could use Date::Calc
http://search.cpan.org/~stbey/Date-Calc-5.3/Calc.pod
It does a great job with everything involving dates ...
Greetz
Stefan
Quoted 5 lines · Stefan Wimmer
* urgrue <[email protected]> wrote on 10/Oct/2003 - 11:54:08 :
Quoted 4 lines
anyone know an easy way to compare dates and display the difference? difference doesnt have to be in date format, in fact it would be even easier if it was just one unit, like "total diff in seconds" or nanoseconds or whatever, doesnt matter.
Sys admin published an article on date handling via shell, perl (and some other option) recently. All the code they discussed is available on their site. You would have to search for it, as I don't have the url handy.
Google for SysAdmin
-chuck
Signature · 7 lines
ACCEL Services, Inc.| Specialists in Gravity, Magnetics | 1(713)993-0671 ph.
2401 Fountain View | and Integrated Interpretation | 1(713)993-0608 fax
Suite 320 | |
Houston, TX, 77057 | Chuck Campbell | [email protected]
| President & Senior Geoscientist |
"Integration means more than having all the maps at the same scale!"Quoted 4 lines · urgrue
anyone know an easy way to compare dates and display the difference? difference doesnt have to be in date format, in fact it would be even easier if it was just one unit, like "total diff in seconds" or nanoseconds or whatever, doesnt matter.
see options -d and %s in date's man page
Signature · 1 line
Never trust anybody whose arm is bigger than your leg.