1833943 Members
1605 Online
110063 Solutions
New Discussion

date command

 
larry o'donoghue
Occasional Contributor

date command

with Linux I can use date +%s to get the time elapsed in seconds since 01/01/1970. Is there a way i can do this in HP-UX. The date command does not seem to directly support this.
7 REPLIES 7
Michael Tully
Honored Contributor

Re: date command

Hi,

The best program I've seen to use and manipulate dates is Sir A. Clay Stephenson's universal date hammer. (caljd.sh)

You can find a copy at this posting, as well as some other intresting scripts and programs.

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x026250011d20d6118ff40090279cd0f9,00.html

HTH
Michael
Anyone for a Mutiny ?
Michael Tully
Honored Contributor

Re: date command

I forgot to mention how to use it.

# caljd.sh 01 01 1970
2440588

# caljd.sh 2440588
01 01 1970

Anyone for a Mutiny ?
John Poff
Honored Contributor

Re: date command

Hi,

As Michael said, Sir Clay's date hammer script is the swiss army knife of date/time scripts. However, if you get caught in a pinch and you have Perl, you can always do this:

perl -e 'print time'
1037674435

and you'll get the same answer as you are used to getting from date +%s in Linux. :)

JP
Shahril M
Frequent Advisor

Re: date command

What happened to bob?
harry d brown jr
Honored Contributor

Re: date command


Shahril,

I think bob went here: http://www.reel.com/movie.asp?MID=1671

As for Dave, man, "Dave's not here".


live free or die
harry
Live Free or Die
John Poff
Honored Contributor

Re: date command

Harry,

I think Shahril is asking about Micro$oft Bob. Remember, the home GUI interface they came out with back in the mid nineties, just before they released Windows 95? :)

http://toastytech.com/guis/bob2.html

JP
larry o'donoghue
Occasional Contributor

Re: date command

hey Shahril ....bob had to go, he was'nt getting very good answers man