Changeset 5550eb0


Ignore:
Timestamp:
Jun 9, 2009, 12:37:12 PM (12 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
master, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
30e7ffd
Parents:
d1ae4a4
Message:
Default style: Use strftime() on unix_time

Instead of parsing time_str using a regex, just call strftime on the
actual time_t to format the bits we want.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • perl/lib/BarnOwl/Style/Default.pm

    ree183be r5550eb0  
    33
    44package BarnOwl::Style::Default;
     5use POSIX qw(strftime);
     6
    57################################################################################
    68# Branching point for various formatting functions in this style.
     
    4042    my $self = shift;
    4143    my $m = shift;
    42     my ($time) = $m->time =~ /(\d\d:\d\d)/;
    43     return $time;
     44    return strftime('%H:%M', localtime($m->unix_time));
    4445}
    4546
Note: See TracChangeset for help on using the changeset viewer.