It works perfectly as expected. My problem is when i try to reuse it within a set of perl modules to write the day to a HTML file, it fails. the relevant section of code looks like this:use Date::Day; ## The following will print the weekday corresponding my $fragment = '2010-03-23 17:00:00'; $fragment = substr $fragment, 0, 10; my ( $year, $month, $day ) = split /-/, $fragment; $fragment = &day($month,$day,$year); $fragment = $fragment." $day-$month"; print "$fragment";
the $ref{'time'} is a variable used to store the MYSQL DATETIME and i know this is 100% working as i can dump out date info to HTML no problem, its when trying to use the Day method from Date::Day that i get a problem. The code is 'live' and runs on everyday at 5pm on a scheduled task so its hard for me to thouroghly debug the issue. I have been trying suss out what is wrong for a while now but cant put my finger on it. Can anyone help?use Date::Day; ... my $fragment; if ($table =~ m/daily/) {$fragment = substr $ref->{'time'}, 0, 10; my ( $year, $month, $day ) = split /-/, $fragment; $fragment = &day($month,$day,$year); $fragment = $fragment." $day-$month"; } + else {$fragment = substr $ref->{'time'}, 11, 5;} + #write times to micro HTML printf MICROHTML '<td class="time">'; printf MICROHTML "$fragment"; printf MICROHTML '</td>';}
In reply to Date::Day issues by Conal
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |