| Plagger documentation | Contained in the Plagger distribution. |
Plagger::Plugin::Filter::ForceTimeZone - Force set Timezone regardless of it's UTC or floating
- module: Filter::ForceTimeZone
This plugin force fixes timezone of entries datetime to that of Plagger global timezone. While Filter::FloatingDateTime only fixed timezone when datetime is floating, this plugin changes all datetime TZ regardless of it's UTC or floating.
If global timezone is not set, this module tries to use system local timezone.
Tatsuhiko Miyagawa
| Plagger documentation | Contained in the Plagger distribution. |
package Plagger::Plugin::Filter::ForceTimeZone; use strict; use base qw( Plagger::Plugin ); sub register { my($self, $context) = @_; $context->register_hook( $self, 'update.entry.fixup' => \&update, ); $self->{tz} = $self->conf->{timezone} || $context->conf->{timezone} || 'local'; } sub update { my($self, $context, $args) = @_; $args->{entry}->date and $args->{entry}->date->set_time_zone($self->{tz}); } 1; __END__