[rt-users] ticket created from CLI script with wrong Due date; timezone issue?

Alex Peters alex at peters.net
Mon Jun 30 02:45:04 EDT 2014


RT::Extension::RepeatTicket doesn't suit my specific needs, so I'm
implementing a solution using scrips and templates.

I should have given more regard to your earlier remark about the time
parsing configuration options—after playing with Time::ParseDate
separately, I determined that PREFER_FUTURE needs to be set.  Setting
$AmbiguousDayInFuture to 1 has fixed my problem.


On 20 June 2014 02:31, Kevin Falcone <falcone at bestpractical.com> wrote:

> On Thu, Jun 19, 2014 at 11:25:52AM +1000, Alex Peters wrote:
> > The code posted in my original message, minus the $ticket->Create call,
> > generates debug output showing the problem independent of ticket
> creation.  In
> > that message I've highlighted the  discrepancies in that debug output in
> red.
> > Your comments on that specific output would be greatly appreciated.
> >
> > I don't believe that the date/time configuration options are relevant,
> because
> > I'm explicitly specifying "11am Wednesday" in an RT::Date->Set call and
> getting
> > an epoch for "11am Tuesday."  My timezone is not offset from GMT by 24
> hours.
>
> Since RT::Date uses Time::ParseDate, I'm not sure that your syntax is
> valid.
>
> https://metacpan.org/pod/Time::ParseDate
>
> Time::ParseDate is going to default to shenanigans when you feed it
> bad data.
>
> I'm not yet convinced of an actual RT::Date bug here, just bad input
> to ParseDate and timezone confusion (remember whose timezone is
> applied when you create an RT::Date with the System User).
>
> use lib './lib';
> use RT -init;
>
> my $due_date = RT::Date->new($RT::SystemUser);
> $due_date->Set(
>  Value => '11am tomorrow',
>  Format => 'unknown',
>  Timezone => 'America/New_York',
> );
> print $due_date->ISO;
>
> works fine for me, using days in the parser does not, but that does not
> surprise me, Time::ParseDate is fragile, although doesn't try to use the
> Julian calendar as often as other parsing modules.
>
> Have you considered
> https://metacpan.org/pod/RT::Extension::RepeatTicket
>
> -kevin
>
> --
> RT Training - Boston, September 9-10
> http://bestpractical.com/training
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20140630/fc4cdb34/attachment.html>


More information about the rt-users mailing list