Unix time stamp

Unix time stamp

Post by Walter u. » Sat, 06 Nov 2004 16:22:39


Can any happy Unix user pleeez send me a line

dd.mm.yyyy hh:mi:ss -> corresponding unix-time-stamp

?

adTHANKSvance
Walter mailto: pachl attt chello.at
 
 
 

Unix time stamp

Post by Walter u. » Sat, 06 Nov 2004 16:30:31

Ahhhh - my problem appears to be the UTC!
And how do I get the time difference of the computer I'm running on
towards UTC (in Rexx)?

Thanks

"Walter u. Christel Pachl" < XXXX@XXXXX.COM > schrieb im Newsbeitrag

 
 
 

Unix time stamp

Post by Walter u. » Sat, 06 Nov 2004 21:37:14


"Walter u. Christel Pachl" < XXXX@XXXXX.COM > schrieb im Newsbeitrag

Just to make sure, please send me a few from different time zones
and DO ADD the location/time zone where you took this measure!!!
 
 
 

Unix time stamp

Post by imc » Sat, 06 Nov 2004 23:02:00

Probably Walter u. Christel Pachl typed into a real computer:

ANSI standard has TIME('o') giving the number of seconds east of GMT.
If your Rexx doesn't have that then it's down to operating system hacks,
I should think. On Unix (Linux and Solaris at least) you can say
"date -u" to get the date in UTC, so you can probably find out
by comparing that to the date in your local timezone.

GNU date also has "date +%s" to give the result as a Unix timestamp.
It also has this:

$ date -d '29 Jul 2003 23:48 BST' +%s
1059518880

which is what you wanted in the first place. However, beware of
daylight savings time: if you are trying to convert a date in the
past then the offset from GMT may not be the same as it is today. The
GNU date command above will take daylight savings time into account if
you leave off the timezone in the input date. It then uses the info from
your TZ environment variable, or the system default:

$ date -d '29 Jul 2003 23:48' +%s
1059518880
$ TZ=GB date -d '29 Jul 2003 23:48' +%s
1059518880
$ TZ=UTC date -d '29 Jul 2003 23:48' +%s
1059522480
$ TZ=US/Eastern date -d '29 Jul 2003 23:48' +%s
1059536880

--
---- Ian Collier : XXXX@XXXXX.COM : WWW page (including REXX section):
------ http://www.yqcomputer.com/

New to this group? Answers to frequently-asked questions can be had from
http://www.yqcomputer.com/
 
 
 

Unix time stamp

Post by Frank Elle » Sun, 07 Nov 2004 10:51:18


Maybe look at < http://www.yqcomputer.com/ ;, it's very
clumsy and incomplete. Otherwise the basic idea should be:

/**/ parse value date( 'b' ) time() with DAYS HH ':' MM ':' SS

Then substract the base date of 1970-01-01 from DAYS, and add
the stuff: TIMESTAMP = DAYS*24*3600 + HH*3600 + MM*60 + SS

Bye, Frank