Your month value will be off by one (did you test this code?), as the value returned is designed to be used as an offset into an array of month names. Thus, if today is the 14th February 2002, your $date will contain "1/14/2002".
Where possible, one should try to avoid regional date formatting styles, and use the ISO 8601 norm, to whit, "2002/02/14". The date 2/6/2002 can be parsed as either 2nd of June or 6th of February, depending on which part of the world you live in.
In Perl 6, this odd behaviour will be corrected, insofar as the year value will be returned as 2002, not 102. Something to keep in mind. Off hand, I remember the month value as also being fixed (hence 2 for February).
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|