Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re: Date function

by cursion (Pilgrim)
on Aug 02, 2013 at 20:52 UTC ( #1047654=note: print w/replies, xml ) Need Help??

in reply to Date function

It looks like you can display the current date and time. You just need to subtract 24 hours from now to get to yesterday.
localtime( time() - (24 * 60 * 60) );
Combine that with strftime() and youre done.

EDIT (after comment below): Make sure your timezone is set correctly too.

Replies are listed 'Best First'.
Re^2: Date function
by tobyink (Canon) on Aug 03, 2013 at 14:54 UTC

    A reasonable approach, though if you live somewhere that observes daylight savings, it will produce incorrect results for one hour, twice each year.

    package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1047654]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2020-11-29 16:47 GMT
Find Nodes?
    Voting Booth?

    No recent polls found