Lines Matching defs:format
21 my($class, $format) = @_;
31 if($format eq "ABSOLUTE") {
32 $format = "HH:mm:ss,SSS";
33 } elsif($format eq "DATE") {
34 $format = "dd MMM yyyy HH:mm:ss,SSS";
35 } elsif($format eq "ISO8601") {
36 $format = "yyyy-MM-dd HH:mm:ss,SSS";
37 } elsif($format eq "APACHE") {
38 $format = "[EEE MMM dd HH:mm:ss yyyy]";
41 if($format) {
42 $self->prepare($format);
51 my($self, $format) = @_;
57 # my strategy here is to split the format into active and literal
69 foreach my $chunk ( split /('(?:''|[^'])*')/, $format ) {
78 croak "bad date format \"$format\": " .
110 # Then, we're setting up an array, specific to the current format,
115 # So, we're parsing the "yyyy/MM" format once, replace it by, say
122 # So, the array to compute the time format at logtime contains
130 # This way, we're parsing the original format only once (during system
133 # of placeholders in the format.
277 sub format {
320 my $format = Log::Log4perl::DateFormat->new("HH:mm:ss,SSS");
324 print $format->format($time), "\n";
330 print $format->format($secs, $msecs), "\n";
374 For example, if you want to format the current Unix time in
375 C<"MM/dd HH:mm"> format, all you have to do is this:
379 my $format = Log::Log4perl::DateFormat->new("MM/dd HH:mm");
382 print $format->format($time), "\n";
384 While the C<new()> method is expensive, because it parses the format
386 followup calls to C<format()> are fast, because C<DateFormat> will