I'll be interested in any other solutions people have because I've got this
going in a couple of programs now... Check out Time::timelocal().  It allows
you to pass inthe results of localtime and bet back the seconds since the
epoch.  Since the results of localtime are things that you  can actually
parse from a command line this timelocal thing becomes pretty usefull.   You
might do something like:

$date = <>;  #let's say you know they will enter it in mm/dd/yy format
($mon, $day, $year) = split !/!;
$year += 100;
$seconds = timelocal ($mon, $day, $year);

BTW this probably won't work as it is because I'm going by memory and as I
recall time local needs more info than m/d/y so you will probably need to
generate this.  Check out the documentation on timelocal and also perlfaq4
for some info.

Hope this helps,
Peter C.


[EMAIL PROTECTED] wrote:

> Hi,
>
> I try to write a program that will executes a command on a specific time
> inputted by a user. I don't know how you can compare the time of the user
> with the computer clock ?
>
> Can anyone help me to do the. I'm a beginner.
>
> Thanks in advance
>
> Michiel
>
> --------------------------------------------
> OMNIS SOURCE
> Lozenberg, 6         Phone +32(0)2/721.54.10
> B-1932 Zaventem      Fax   +32(0)2/725.88.50
> BELGIUM              http://www.source.be

Reply via email to