# # Copyright 2003 Kevin Golding # All rights reserved # Requires the perl module Time::ParseDate (part of the time-modules package) # package MT::Plugin::Epoch; use MT::Template::Context; use Time::ParseDate; MT::Template::Context->add_global_filter(convert_to_epoch => sub { &from_epoch; }); sub from_epoch { my $time = shift; my $arg_value = shift; my $ctx = shift; $epoch = parsedate($time); return $epoch; } 1;