I meant that you might want to use Date::Calc::Object and Date::Calendar with HTML::CalendarMonth.

What is the point of calculating Date_to_Days? Why not store it in epoch seconds instead?

Quick example to illustrate epoch seconds...

#!/usr/bin/perl use strict; use warnings; use Time::Local; my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst); $mday = 13; $mon = 9; # 0 - 11, so this is October $year = 1973; # use 12pm my $seconds = timelocal(0,0,12,$mday,$mon,$year); print "epoch seconds: $seconds.\n"; ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($sec +onds); $year += 1900; $mon++; printf "%02d:%02d:%02d %04d-%02d-%02d\n", ($hour,$min,$sec,$year,$mon, +$mday);

update: You could also use the Date_to_Time and Time_to_Date functions of Date::Calc.

#!/usr/bin/perl use strict; use warnings; use Date::Calc qw(:all); my ($sec,$min,$hour,$day,$month,$year, $seconds); $sec = 0; $min = 0; $hour = 12; $day = 13; $month = 10; $year = 1973; $seconds = 0; # use 12pm $seconds = Date_to_Time($year,$month,$day, $hour,$min,$sec); print "epoch seconds: $seconds.\n"; ($year,$month,$day, $hour,$min,$sec) = Time_to_Date($seconds); printf "%02d:%02d:%02d %04d-%02d-%02d\n", ($hour,$min,$sec,$year,$mont +h,$day);


In reply to Re: Re: Re: Date::Calc to HTML::CalendarMonth by Mr. Muskrat
in thread Date::Calc to HTML::CalendarMonth by jonnyfolk

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.