"Rob Dixon" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> "Deborah Scott" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > I thought I understood the answer, but I need more details.
> >
> > What exactly would I enter if I want a program to find the epoch time
for
> > midnight each night? I know how to find "current" time and date in both
> > "human" time and epoch time.
> >
> > I want to generate a report that displays the events that are scheduled
to
> > occur each day. (from midnight to midnight)
>
> Hi Deborah
>
> I'm not at all sure you need to use any modules like Time::Local. Just
> convert your epoch seconds into epoch days by dividing by 8400 (seconds
per
> day).
>
>     my $epoch_today = time / 8400;
>
>     if ($event_start / 8400 == $epoch_today or $event_end / 8400 ==
> $epoch_today)
>     {
>         :
>     }
>

This is okay, except for as pointed out in the following post, 8400 is not
the number you want to divide by, which further illustrates why one should
usually turn to a module instead of roll-your-own. This would be a tricky
bug to find if it was scripted along with thousands of other lines of code.

 btw, Time::Local is shipped with almost all distros of perl >= 5.0 by
default.

Todd W.



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to