In lists.projects.perl.modules, you wrote:
>On Sun, Sep 16, 2001 at 11:40:20AM -0400, Thomas Stanley wrote:
>
>> Name: Thomas Stanley
>> Email: [EMAIL PROTECTED]
>> Homepage: N/A
>> Preferred User Id: TSTANLEY
>> Description: I would like to contribute a module called Date::Lastday.  
>> This module can be used to calculate the date of the previous day (i.e. 
>> Today is 16 Sep 2001, the module will accurately calculate the date of 
>> yesterday, which was the 15th.) This module is accurate enough to provide 
>> coverage for the 1st of each month (including New Year's Day), and for 
>> leap years.Get more from the Web.  
>
>Like this?
>
>   #!/usr/local/bin/perl
>
>   use Date::Manip;
>
>   $yesterday = ParseDate("yesterday");

And it's a one-liner to do it in pure perl.  Here's a very simple
version:

    print scalar localtime(time - 24 * 60 * 60);

Thomas, I strongly recommend that you don't bother with this particular
module, except perhaps as a learning exercise. 

But if you're interested in date and time calculations in Perl, or
intend to write any more complex date/time modules, I suggest you
subscribe to [EMAIL PROTECTED] and talk to the other date/time hackers
over there.

K.

-- 
Kirrily 'Skud' Robert - [EMAIL PROTECTED] - http://infotrope.net/
"4 December, 1668. Had a venison Pastie at The Liver-Spotted Hande that was 
palpable Beefe. Mrs. Pepys and Myself thrown into ye Microwayvve, where we 
did Expand Mightily, to a Frighteningly Enormous Syze. And so to Bed."

Reply via email to