Hay.... I need some help... I am trying to figure out Unix time for a certain day at noon lets say.... example... 06/15/00 @ noon Is there a program that will give you the Unix time based on the start date 1/1/70. Something like that... I am beating my head against the wall.. -- Kirk Moore Black Holes are created when God divides by zero. -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/Support/Doku/FAQ/
The Perl package Time::Local will do this. So put the following script in a file and perl it. Change the values at the top as needed, and remember to use 24-hour time for the hours. -tara --------------- #!/usr/bin/perl use Time::Local; $sec = 0; $min = 0; $hr = 12; $day = 15; $month = "June"; $year = 2000; %mno = ( January => 0, February => 1, March => 2, April => 3, May => 4, June => 5, July => 6, August => 7, September => 8, October => 9, November => 10, December => 11,); $time = timelocal($sec,$min,$hr,$day,$mno{$month},$year); print "$time\n"; $timestr = localtime($time); print "$timestr\n"; ------------------- On Thu, 4 May 2000, Kirk Moore wrote:
Hay....
I need some help... I am trying to figure out Unix time for a certain day at noon lets say....
example... 06/15/00 @ noon
Is there a program that will give you the Unix time based on the start date 1/1/70. Something like that... I am beating my head against the wall..
-- Kirk Moore
Black Holes are created when God divides by zero.
-- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/Support/Doku/FAQ/
-- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/Support/Doku/FAQ/
At 06:14 PM 05/04/00 -0700, Kirk Moore wrote:
I need some help... I am trying to figure out Unix time for a certain day at noon lets say....
Do you like Perl? perldoc Time::Local NAME Time::Local - efficiently compute time from local and GMT time SYNOPSIS $time = timelocal($sec,$min,$hours,$mday,$mon,$year); $time = timegm($sec,$min,$hours,$mday,$mon,$year); DESCRIPTION These routines are the inverse of built-in perl fuctions localtime() and gmtime(). They accept a date as a six- element array, and return the corresponding time(2) value in seconds since the Epoch (Midnight, January 1, 1970). This value can be positive or negative. Bill Moseley mailto:moseley@hank.org -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/Support/Doku/FAQ/
On 4 May, Kirk Moore wrote:
Hay....
I need some help... I am trying to figure out Unix time for a certain day at noon lets say....
example... 06/15/00 @ noon <snip>
From a Unix script or prompt, the "date" command will work: date --date="12PM 06/15/2000" +%s
The "+%s" tells 'date' to output the number of seconds since midnight, January 1, 1970. 'date' also accepts relative dates, like: date --date="12PM this sunday" +%s -- Robert Wohlfarth rjwohlfar@bigfoot.com "My theory's right. Reality needs to be fixed." -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/Support/Doku/FAQ/
participants (4)
-
kmoore@aa.net
-
moseley@hank.org
-
rjwohlfar@bigfoot.com
-
tla@akamai.com