Month number being returned not correct 
Author Message
 Month number being returned not correct

Hi,

I'm new to Perl, pls excuse my ignornace. The following Perl code:


localtime(time);
$outfile = sprintf "%s/%4d-%2.2d-%2.2d-", $base_dir, $year + 1900,
$month, $day;

and I read somewhere that the month value returned by localtime is 0
to 11, and that is what the problem is, a (flat) file created in May
will have month value of 4.

How do I increment the variable $month by 1 ? Is it just:

    $month++;

Thanks,

Peter

Peter Richards

 (but use hotmail to email)



Wed, 26 Oct 2005 11:27:56 GMT  
 Month number being returned not correct
Oops, soory, wrong newsgroup

On Sat, 10 May 2003 13:27:56 +1000, Peter Richards

[SNIP]

Peter Richards

 (but use hotmail to email)



Wed, 26 Oct 2005 11:30:06 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. SQL and Date format - Am I correct?

2. BDE data losss problem (again sorry ,corrected return e-mail address)

3. Rounding in database not correct ??

4. Active Buffer seems not to work correct

5. number of returned records

6. Number of records returned by TQuery

7. D2: TQuery - Limiting number of records returned from Paradox 7.0 Table

8. TInteger Field returns only positive numbers.

9. Counting the number of records returned from a search

10. Losing File Handles - But I am not using Files

11. Why am I not getting the RTE 200?

12. Insert does not return an error

 

 
Powered by phpBB® Forum Software