The Day_of_Year Function returns a 3 digit number like 176 that I am trying to convert to a textual date like July 25 ,2003.

OK, by running the command "perldoc Date::Calc", we see:

Day_of_Year $doy = Day_of_Year($year,$month,$day);
so your description of the Day_of_Year function isn't quite spot on. If you indeed are able to get a day of year out of the Date::Calc::Day_of_Year function, then you already know the year, day & month, correct?

Staying within the Date::Calc module, your best bet is the Month_to_Text function:

use strict; use Date::Calc qw/Today Month_to_Text/; my ($year, $month, $day) = Today(); # work with today's date print sprintf("%s %d, %d", Month_to_Text($month), $day, $year);
HTH

In reply to Re: Need Help with DATE::CALC $doy by cleverett
in thread Need Help with DATE::CALC $doy by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.