#!/usr/bin/perl use lib '/opt/rt3/lib'; package RT; use strict; use Time::ParseDate; use RT::Interface::CLI qw(CleanEnv); CleanEnv(); RT::LoadConfig(); RT::Init(); use RT::Date; my $now = time; printf("current time() output: %s\n", $now); print "\n"; printf("fixed-date Time::ParseDate: %s\n", Time::ParseDate::parsedate('2012-06-08 10:00:00')); printf("tomorrow 10am Time::ParseDate: %s\n", Time::ParseDate::parsedate('tomorrow 10am')); print "\n"; my $date = new RT::Date($RT::SystemUser); printf("fixed-date RT::Date output: %s\n", $date->Set(Format => 'sql', Value => '2012-06-08 10:00:00')); printf("tomorrow 10am RT::Date output: %s\n", $date->Set(Format => 'unknown', Value => 'tomorrow 10am')); printf("timezone according to RT::Date: %s\n", ($date->Localtime( 'user', $now ))[9]);