RT 2.0.3 and Dates

Hi there. I recently installed 2.0.3 and upon playing, I see "Not set"
everywhere a time and date should be. Everything else seems to work…

System config:

Solaris 8 x86
Apache 1.3.20 + mod_perl 1.26
Perl 5.6.1
Postgres 7.1.2
testdeps passes without a problem

Little help?

Rob

Hi,
I can tell you your problem - the postgres DATESTYLE variable is set to something other than ISO - at present RT only knows how to deal with this.
To confirm this,
% psql rt2
rt2=> show datestyle;
This will give you the current datestyle in use, you’ll see it’s probably Postgres.

Workaround:
To change it, edit ~pgsql/.profile, set the variable PGDATESTYLE=ISO and restart postgres. This’ll change the datestyle for all your dbs though.

Fix:
I hope to get time to fix this by the end of the week, unless Jesse gets around to it first.

-Feargal.On Tue, 24 Jul 2001 15:43:08 -0700 “Rob” falcon@rasterburn.com wrote:

Hi there. I recently installed 2.0.3 and upon playing, I see “Not set”
everywhere a time and date should be. Everything else seems to work…

System config:

Solaris 8 x86
Apache 1.3.20 + mod_perl 1.26
Perl 5.6.1
Postgres 7.1.2
testdeps passes without a problem

Little help?

Rob


rt-users mailing list
rt-users@lists.fsck.com
http://lists.fsck.com/mailman/listinfo/rt-users

Feargal Reilly,
Systems Administrator,
The CIA.

I’d be curious to know if the following improves things:

in DBIx/SearchBuilder/Handle/Pg, there’s a line:

$self->SimpleQuery("SET TIME ZONE 'GMT'");

After this line, add the line:

$self->SimpleQuery("SET DATESTYLE 'ISO'");On Wed, Jul 25, 2001 at 12:53:05PM +0100, Feargal Reilly wrote:

Hi,
I can tell you your problem - the postgres DATESTYLE variable is set to something other than ISO - at present RT only knows how to deal with this.
To confirm this,
% psql rt2
rt2=> show datestyle;
This will give you the current datestyle in use, you’ll see it’s probably Postgres.

Workaround:
To change it, edit ~pgsql/.profile, set the variable PGDATESTYLE=ISO and restart postgres. This’ll change the datestyle for all your dbs though.

Fix:
I hope to get time to fix this by the end of the week, unless Jesse gets around to it first.

-Feargal.

On Tue, 24 Jul 2001 15:43:08 -0700 “Rob” falcon@rasterburn.com wrote:

Hi there. I recently installed 2.0.3 and upon playing, I see “Not set”
everywhere a time and date should be. Everything else seems to work…

System config:

Solaris 8 x86
Apache 1.3.20 + mod_perl 1.26
Perl 5.6.1
Postgres 7.1.2
testdeps passes without a problem

Little help?

Rob


rt-users mailing list
rt-users@lists.fsck.com
http://lists.fsck.com/mailman/listinfo/rt-users


Feargal Reilly,
Systems Administrator,
The CIA.

jesse reed vincent – root@eruditorum.orgjesse@fsck.com
70EBAC90: 2A07 FC22 7DB4 42C1 9D71 0108 41A3 3FB3 70EB AC90

“If IBM wanted to make clones, we could make them cheaper and faster than
anyone else!” - An IBM Rep. visiting Vassar College’s Comp Sci Department.

After this line, add the line:

$self->SimpleQuery(“SET DATESTYLE ‘ISO’”);

Make it

$self->SimpleQuery(“SET DATESTYLE TO ‘ISO’”);
^^

For some silly reason Postgres only accepts time zone declarations
without “TO”, all other variables should be set with “TO” or “=”.

Martin

Martin Schapendonk, martin@schapendonk.org, Phone: +31 (0)6 55770237
Student Information Systems and Management at Tilburg University

“j” == jesse jesse@fsck.com writes:

j> I’d be curious to know if the following improves things:
j> in DBIx/SearchBuilder/Handle/Pg, there’s a line:

j> $self->SimpleQuery(“SET TIME ZONE ‘GMT’”);

Is this why all my dates on the ticket summary show up as GMT rather
than local time (eastern time)?

“j” == jesse jesse@fsck.com writes:

j> I’d be curious to know if the following improves things:
j> in DBIx/SearchBuilder/Handle/Pg, there’s a line:

j> $self->SimpleQuery(“SET TIME ZONE ‘GMT’”);

Is this why all my dates on the ticket summary show up as GMT rather
than local time (eastern time)?

This is part of the reason. But just changing this isn’t recommended,
as other parts of RT assume that the internal date format is in GMT.
You’re much better off hacking on and contributing updates to RT::Date’s
display routines. The eventual goal is to support the ability for users
to set their own timezones regardless of the system zone.


rt-users mailing list
rt-users@lists.fsck.com
http://lists.fsck.com/mailman/listinfo/rt-users

jesse reed vincent – root@eruditorum.orgjesse@fsck.com
70EBAC90: 2A07 FC22 7DB4 42C1 9D71 0108 41A3 3FB3 70EB AC90

“That package looks like what I wanted, but the site was down today,
so I decided to reimplement it in Perl.”
-me

Right. I tracked this down to PGDATESTYLE. But I don’t think this is a
postgres issue. RT2 assumes that the date styles ‘sql’ and ‘iso’ are the
same, but in postgres they are not.

The fix you suggest will NOT work for as I have other applications depending
on the datasytle being ‘SQL’ and not ISO.

The better solution for this would be to SET DATESTYLE TO ‘ISO’ somewhere
within RT2 and recreate the database. As soon as I find the right place,
I’ll send in a patch.

Rob----- Original Message -----
From: “Feargal Reilly” feargal@thecia.ie
To: rt-users@lists.fsck.com
Sent: Wednesday, July 25, 2001 4:53 AM
Subject: Re: [rt-users] RT 2.0.3 and Dates

Right. I tracked this down to PGDATESTYLE. But I don’t think this is a
postgres issue. RT2 assumes that the date styles ‘sql’ and ‘iso’ are the
same, but in postgres they are not.

The fix you suggest will NOT work for as I have other applications depending
on the datasytle being ‘SQL’ and not ISO.

Actually, it should work, because the datestyle is only set for that connection/session. New connections from other apps will still have your default datestyle.

The better solution for this would be to SET DATESTYLE TO ‘ISO’ somewhere
within RT2 and recreate the database. As soon as I find the right place,
I’ll send in a patch.

Rob

----- Original Message -----
From: “Feargal Reilly” feargal@thecia.ie
To: rt-users@lists.fsck.com
Sent: Wednesday, July 25, 2001 4:53 AM
Subject: Re: [rt-users] RT 2.0.3 and Dates


rt-users mailing list
rt-users@lists.fsck.com
http://lists.fsck.com/mailman/listinfo/rt-users

Feargal Reilly,
Systems Administrator,
The CIA.

With $self->SimpleQuery(“SET DATESTYLE TO ‘ISO’”); set, it still stores the
timestamps in the DB as the default date style. So it looks like something
else needs to be done.

As a work around, I just added some code in Date.pm to parse the ‘sql’ date
style.

If you have any other suggestions, I’ll test 'em out.

Thanks,

Rob

With $self->SimpleQuery(“SET DATESTYLE TO ‘ISO’”); set, it still stores the
timestamps in the DB as the default date style. So it looks like something
else needs to be done.

No, that’s fine - it doesn’t matter what datestyle you’re using when the value is being stored.
I trashed this out with Jesse a while ago, and he set me straight. He seems to be quiet today, so I’ll catch you up.

When you set the datestyle, you’re essentially saying ‘Gimme dates in the following format so I know how to parse them’ - it doesn’t affect the internals.

To see what I mean, look at the following sequence of commands:

feargal@ithil-es: psql rt2
rt2=>show datestyle;
NOTICE: DateStyle is SQL with European conventions

rt2=>select created from transactions where id=1;
30/12/1999 16:38:14.00 GMT

rt2=>set datestyle to iso;
rt2=>select created from transactions where id=1;
1999-12-30 16:38:14+00

rt2=>! psql rt2

rt2=>show datestyle;
NOTICE: DateStyle is SQL with European conventions
rt2=>\q
rt2=>\q
feargal@ithil-es:

The datestyle only changes the format in which the data is handed to you.

Notice I started a second session, from within the first, and the datestyle was back to the default for my postgres.

As a work around, I just added some code in Date.pm to parse the ‘sql’ date
style.

That’s what I’d done too, Jesse corrected me - the idea with Searchbuilder is that it’ll provide a consistent way to deal with the different DBIs - mysql, postgres and Oracle.
ISO is consistent across them all, so by setting the datestyle, RT knows what format the timestamps will be in.

I guess that the two of us are the only postgres users with non-ISO datestyles as default, so it never came up before.

Feargal Reilly,
Systems Administrator,
The CIA.

I see the light. Thanks for the lesson. :slight_smile: After replacing Date.pm with
the stock version from 2.0.4 and making the DBIx fix, it indeed solved the
problem.

A most honorable and humble thank you to you both.

Rob----- Original Message -----
From: “Feargal Reilly” feargal@thecia.ie
To: rt-users@lists.fsck.com
Sent: Wednesday, July 25, 2001 3:37 PM
Subject: Re: [rt-users] RT 2.0.3 and Dates

Does RT2 have calendaring functions? i.e., we have licenses set to
expire, and my boss wants to know if we can use RT to either graphically
display that or remind us somehow that they’re coming due to be renewed.

Another way to phrase the question is, how much would it cost us to get
that functionality? :slight_smile:

Sheeri Kritzer
Systems Administrator
University Systems Group
Tufts University
617-627-3925
skritz01@emerald.tufts.edu

Does RT2 have calendaring functions? i.e., we have licenses set to
expire, and my boss wants to know if we can use RT to either graphically
display that or remind us somehow that they’re coming due to be renewed.

Well, what I’d recommend with exisitng code is to create tickets
for “Renew license” and set the apropriate due dates.

If you want a real asset manager that could handle these things properly,
we should probably talk off-list

    -j

Sheeri Kritzer
Systems Administrator
University Systems Group
Tufts University
617-627-3925
skritz01@emerald.tufts.edu


rt-users mailing list
rt-users@lists.fsck.com
http://lists.fsck.com/mailman/listinfo/rt-users

jesse reed vincent – root@eruditorum.orgjesse@fsck.com
70EBAC90: 2A07 FC22 7DB4 42C1 9D71 0108 41A3 3FB3 70EB AC90

pretty soon we’re going to HAVE to have hypertext mail!
–Tim Berners Lee. (8 Jan 1993 on www-talk)

Does RT2 have calendaring functions? i.e., we have licenses set to
expire, and my boss wants to know if we can use RT to either graphically
display that or remind us somehow that they’re coming due to be renewed.

Well, what I’d recommend with exisitng code is to create tickets
for “Renew license” and set the apropriate due dates.

If you want a real asset manager that could handle these things properly,
we should probably talk off-list

The iCalendar standard (rfc2445) is the internet standard protocol
for calendaring and scheduling. (Well, it’s standards-track,
but lots of things already support it. MS Exchange, Lotus Notes,
iPlanet calendar server…) It provides a standard way for you
to say, “This event happens at this time in the future; remind me
3 days before.” It also does lots of other things, but that’s the part
I think you’d care about.

I’m a developer on the Reefknot project, which is building tools
for shared calendaring in Perl. We want to make it easy to write
calendar tools, so companies don’t have to depend on Exchange to
have calendar services. One of the things we’re going
to be working on is web-based calendaring applications. I suspect that
tying into our modules for scheduling purposes might be fruitful for
you. I’m one of the lead developers, and I’d be willing to help
you get up the learning curve if you’re interested in having
RT’s calendar-related functions be more robust.

The module you want to look at is Net::ICal, available on CPAN and
at http://reefknot.sourceforge.net. It requires Date::ICal, available
in the same places. If you’re just interested in what we’re doing
as a project, mail me offlist.

srl

Shane Landrum (srl AT boston DOT com) Software Engineer, boston.com