Adam,

That worked.  I combined the localtime and Date::Calc functions to get the result:

2002-01-01

The problem is that I need to assign the result to a variable and still maintain 2 
characters for month and day.  This info must be sent to a database that only 
understands the format yyyy-mm-dd.

If I dont print with printf using %04d-%02d-%02d, I get only single characters.

>>> "Adam Frielink" <[EMAIL PROTECTED]> 03/20/02 12:33PM >>>
If you run this on the first, try localtime((time)-60*60*24) and then
manipulate the returned list.

Or I believe Date::Calc has a Day_In_Month method which only requires the
year and month for paramters.

Adam

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED]]On Behalf Of
> Craig Sharp
> Sent: Wednesday, March 20, 2002 10:54 AM
> To: [EMAIL PROTECTED] 
> Subject: [Perl-unix-users] Finding start and end date for last month
>
>
> I need to be able to find the start and end dates for last month
> on the first of each month.
> Once found, I need to store them in variables in the format
> 2002-02-01, etc.
>
> Does anyone have a script to do this or can you point me in the
> right direction?
>
> Thanks,
>
>
> Craig A. Sharp
> Unix Systems Administrator
> DNS Administrator
> Roush Industries
> Office: 734-466-6286
> Cell: 734-231-6769
> Fax: 734-466-6939
> [EMAIL PROTECTED] 
> ====================================================
> I have not lost my mind, it's backed up on tape somewhere!
> ====================================================
>
> _______________________________________________
> Perl-Unix-Users mailing list
> [EMAIL PROTECTED] 
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs 

_______________________________________________
Perl-Unix-Users mailing list
[EMAIL PROTECTED] 
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

_______________________________________________
Perl-Unix-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to