[rt-users] Adding something to Elements/Header

Subredu Manuel diablo at roedu.net
Wed May 16 05:30:16 EDT 2007


 Sorry, I could not help it :P

 my $months = {
  0 => 'January',
  1 => 'February',
  2 => 'March',
  3 => 'April',
  4 => 'May',
  5 => 'June',
  6 => 'July',
  7 => 'August',
  8 => 'September',
  9 => 'October',
 10 => 'November',
 11 => 'December',
};

my @dt = localtime;
$dt[5] += 1900;
print sprintf q{%9s%3s,%5s%3s:%2d:%2d},
        $months->{$dt[4]},
        $dt[3],
        $dt[5],
        $dt[2],
        $dt[1],
        $dt[0];

Do you think it looks better ?

Mathew Snyder wrote:
> I know nothing of CGI and Mason and whatnot so I don't know how to do this
> exactly.  I've sorted a little bit out.  I want to add a timestamp to the header
> which will be centered above the bar that holds the text such as 'RT at a
> glance' or 'Query Builder'.  So far I have it formatted using
> % my %months = (
> %       1  => "January",
> %       2  => "February",
> %       3  => "March",
> %       4  => "April",
> %       5  => "May",
> %       6  => "June",
> %       7  => "July",
> %       8  => "August",
> %       9  => "September",
> %       10 => "October",
> %       11 => "November",
> %       12 => "December");
> 
> % my ($second, $minute, $hour, $day_in_month, $month, $year) = (localtime) [0..5];
> % $year += 1900;
> % printf "%9s%3s,%5s%3s:%2d:%2d", "$months{$month}", "$day_in_month", "$year",
> "$hour", "$minute", "$second";
> 
> I just don't know how to format it like HTML.  How can I center it and place it
> directly above the bar instead of floating at the top of the page?  I'd also
> like to be able to manipulate the font.  Can anyone provide insight?
> 
> Thanks,
> Mathew



More information about the rt-users mailing list