[Buffalo-pm] Getting Date/Time 1 Minute Ago...

Dan Magnuszewski magnachef at gmail.com
Tue Sep 25 13:42:11 PDT 2007


Yeah, that's what I was looking for!

Thanks.

On 9/25/07, Ben. B. <bennymack at gmail.com> wrote:
>
> If you deal with a Unix time_t to start with, it really should be as
> simple as subtracting 60 seconds from it. Then use POSIX::strftime to
> format it however you like.
>
> perl -Mstrict -Mwarnings -MPOSIX -e 'my $time = time; printf( "NOW:
> %s, ONE MINUTE AGO: %s\n", scalar localtime $time, scalar localtime
> $time - 60 );'
>
> I can't think of any situations where that wouldn't work, but I'm often
> wrong...
>
> Ben
>
> On 9/25/07, Dan Magnuszewski <magnachef at gmail.com> wrote:
> > All,
> >
> > I'm looking for a module or Linux command that will allow me to get the
> > date/time one minute ago. I know this sounds trivial (just subtract 1
> from
> > minute) but it can get messy  at midnight on the first of the month, or
> the
> > first day of the year, etc. It's not hard, just a pain to code that up,
> and
> > it'd be nice if there was already something that could do the work for
> me
> > :-)
> >
> > Does anyone know of anything that will do this?
> >
> > -Dan
> >
> >
> > _______________________________________________
> > Buffalo Perl Mongers Homepage
> > http://buffalo.pm.org
> >
> > Buffalo-pm mailing list
> > Buffalo-pm at pm.org
> > http://mail.pm.org/mailman/listinfo/buffalo-pm
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.pm.org/pipermail/buffalo-pm/attachments/20070925/4a721f1a/attachment.html 


More information about the Buffalo-pm mailing list