[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] converting time formats in script
- Subject: [ale] converting time formats in script
- From: dsj at sylvester.dsj.net (David S. Jackson)
- Date: Wed, 15 Aug 2001 13:36:28 -0400
How would you convert a variable stored in UTC Epoch time back to
your particular time zone?
Example:
=-=-=-=- snip -=-=-=-=-=
#!/bin/sh
now=`date +%s`
#as long as x is true, do this loop
while [ x ]; do
echo "I'm waiting for a change in condition"
done
# now the condition has changed and I get on with life
then=`date +%s`
dif=$(($then-$now))
echo $dif
=-=-=-=-=-= snip -=-=-=-=-=-=
How do you express "$dif" in regular format, like date +%H:%M:%S?
Can you convert it on the fly somehow?
TIA!
--
David S. Jackson dsj at dsj.net
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
A black cat crossing your path signifies that the
animal is going somewhere. -- Groucho Marx
--
To unsubscribe: mail majordomo at ale.org with "unsubscribe ale" in message body.