Date/Time Display

Hi,

I'm currently looking at implementing RT on a Solaris system and have 

a question. We have multiple sites and it’d be nice to have ticket
date/time information localised. So for example the Timezone on the
server is set to GB, but if a support person in Boston views the ticket
he sees the date and time the ticket was raised adjusted for his
Timezone. Is this possible? It’s possible in some commercial products
(Remedy does it) but I think you’d need to associate a Timezone with
each user account somehow and RT doesn’t seem to do that. Remedy uses
environment variables and its web client’s actually Java based.

If it is possible in RT could someone let me know where to look to get
more information.

Thanks,

–Ian

Hi,

I’m currently looking at implementing RT on a Solaris system and
have a question. We have multiple sites and it’d be nice to have ticket
date/time information localised. So for example the Timezone on the
server is set to GB, but if a support person in Boston views the ticket
he sees the date and time the ticket was raised adjusted for his
Timezone. Is this possible? It’s possible in some commercial products
(Remedy does it) but I think you’d need to associate a Timezone with
each user account somehow and RT doesn’t seem to do that. Remedy uses
environment variables and its web client’s actually Java based.

Right. To do this, we’d need a per-user timezone setting. It’s not a lot
of code, but not something that anyone’s contributed code for or had us
do for them.

Best,
Jesse

I’m one of the DateTime coders (http://datetime.perl.org) and would be
happy to write and contribute this functionality. Note that it will be
written using the DateTime libraries as these give the only accurate
time zone information available.

Ian: Do you need it before Christmas? Or can I get it to you by
new-year?

Cheers!
RickOn Thu, 2004-12-16 at 15:38, Jesse Vincent wrote:

On Thu, Dec 16, 2004 at 01:06:34AM +0000, Ian Daniel wrote:

Hi,

I'm currently looking at implementing RT on a Solaris system and 
have a question. We have multiple sites and it'd be nice to have ticket 

date/time information localised. So for example the Timezone on the
server is set to GB, but if a support person in Boston views the ticket
he sees the date and time the ticket was raised adjusted for his
Timezone. Is this possible? It’s possible in some commercial products
(Remedy does it) but I think you’d need to associate a Timezone with
each user account somehow and RT doesn’t seem to do that. Remedy uses
environment variables and its web client’s actually Java based.

Right. To do this, we’d need a per-user timezone setting. It’s not a lot
of code, but not something that anyone’s contributed code for or had us
do for them.

Best,
Jesse


The rt-users Archives

Be sure to check out the RT wiki at http://wiki.bestpractical.com

signature.asc (189 Bytes)

Hi Rick ,

Thanks very much for the offer, I could use it now but I'll be more 

than happy to wait until you have time to fit it in after Christmas.

Regards,

–IanOn 16 Dec 2004, at 05:21, Rick Measham wrote:

I’m one of the DateTime coders (http://datetime.perl.org) and would be
happy to write and contribute this functionality. Note that it will be
written using the DateTime libraries as these give the only accurate
time zone information available.

Ian: Do you need it before Christmas? Or can I get it to you by
new-year?

Cheers!
Rick

On Thu, 2004-12-16 at 15:38, Jesse Vincent wrote:

On Thu, Dec 16, 2004 at 01:06:34AM +0000, Ian Daniel wrote:

Hi,

I’m currently looking at implementing RT on a Solaris system and
have a question. We have multiple sites and it’d be nice to have
ticket
date/time information localised. So for example the Timezone on the
server is set to GB, but if a support person in Boston views the
ticket
he sees the date and time the ticket was raised adjusted for his
Timezone. Is this possible? It’s possible in some commercial products
(Remedy does it) but I think you’d need to associate a Timezone with
each user account somehow and RT doesn’t seem to do that. Remedy uses
environment variables and its web client’s actually Java based.

Right. To do this, we’d need a per-user timezone setting. It’s not a
lot
of code, but not something that anyone’s contributed code for or had
us
do for them.

Best,
Jesse


The rt-users Archives

Be sure to check out the RT wiki at http://wiki.bestpractical.com

Hi,

I would think that using a separate environment variable would be 

better if it’s possible to get at it from the browser interface. You
might not want the timezone changed to that of the machine you’re
borrowing for example.

Regards,

–IanOn 16 Dec 2004, at 13:15, Jason A. Diegmueller wrote:

Just a note, to anyone who develops something like this:

It would have to have an option to use the host OS’s current timezone,
or be easily (and I mean VERY easily) changble. I am on the road
about 70% of the time, and the last thing people in my situation need
is another “time zone” knob to remember to turn as they are travelling
about.

Not everyone is always in the same spot.

Just something to think about. Regardless, if someone does create
this, it would be appreciate either way.

-jd

On Thu, 16 Dec 2004, Ian Daniel wrote:

Hi Rick ,

Thanks very much for the offer, I could use it now but I’ll be more
than happy to wait until you have time to fit it in after Christmas.

Regards,

–Ian

On 16 Dec 2004, at 05:21, Rick Measham wrote:

I’m one of the DateTime coders (http://datetime.perl.org) and would
be
happy to write and contribute this functionality. Note that it will
be
written using the DateTime libraries as these give the only accurate
time zone information available.
Ian: Do you need it before Christmas? Or can I get it to you by
new-year?
Cheers!
Rick
On Thu, 2004-12-16 at 15:38, Jesse Vincent wrote:

On Thu, Dec 16, 2004 at 01:06:34AM +0000, Ian Daniel wrote:

Hi,
I’m currently looking at implementing RT on a Solaris system and
have a question. We have multiple sites and it’d be nice to have
ticket
date/time information localised. So for example the Timezone on the
server is set to GB, but if a support person in Boston views the
ticket
he sees the date and time the ticket was raised adjusted for his
Timezone. Is this possible? It’s possible in some commercial
products
(Remedy does it) but I think you’d need to associate a Timezone
with
each user account somehow and RT doesn’t seem to do that. Remedy
uses
environment variables and its web client’s actually Java based.
Right. To do this, we’d need a per-user timezone setting. It’s not
a lot
of code, but not something that anyone’s contributed code for or
had us
do for them.
Best,
Jesse


The rt-users Archives
Be sure to check out the RT wiki at http://wiki.bestpractical.com


The rt-users Archives

Be sure to check out the RT wiki at http://wiki.bestpractical.com

Just a note, to anyone who develops something like this:

It would have to have an option to use the host OS’s current timezone, or be
easily (and I mean VERY easily) changble. I am on the road about 70% of the
time, and the last thing people in my situation need is another “time zone”
knob to remember to turn as they are travelling about.

Not everyone is always in the same spot.

Just something to think about. Regardless, if someone does create this, it
would be appreciate either way.

-jdOn Thu, 16 Dec 2004, Ian Daniel wrote:

Hi Rick ,

Thanks very much for the offer, I could use it now but I’ll be more
than happy to wait until you have time to fit it in after Christmas.

Regards,

–Ian

On 16 Dec 2004, at 05:21, Rick Measham wrote:

I’m one of the DateTime coders (http://datetime.perl.org) and would be
happy to write and contribute this functionality. Note that it will be
written using the DateTime libraries as these give the only accurate
time zone information available.

Ian: Do you need it before Christmas? Or can I get it to you by
new-year?

Cheers!
Rick

On Thu, 2004-12-16 at 15:38, Jesse Vincent wrote:

On Thu, Dec 16, 2004 at 01:06:34AM +0000, Ian Daniel wrote:

Hi,

I’m currently looking at implementing RT on a Solaris system and
have a question. We have multiple sites and it’d be nice to have
ticket
date/time information localised. So for example the Timezone on the
server is set to GB, but if a support person in Boston views the ticket
he sees the date and time the ticket was raised adjusted for his
Timezone. Is this possible? It’s possible in some commercial products
(Remedy does it) but I think you’d need to associate a Timezone with
each user account somehow and RT doesn’t seem to do that. Remedy uses
environment variables and its web client’s actually Java based.

Right. To do this, we’d need a per-user timezone setting. It’s not a lot
of code, but not something that anyone’s contributed code for or had us
do for them.

Best,
Jesse


The rt-users Archives

Be sure to check out the RT wiki at http://wiki.bestpractical.com


The rt-users Archives

Be sure to check out the RT wiki at http://wiki.bestpractical.com

RT Users:

Opening note: Please, please, please stop punishing me for posting to this
list. Every time I post, I get innundated with Out Of Office Replies. I
don’t want them. Can’t you disable them on mailing lists?

Ian, as for your comment, maybe an additional dropdown (use host browser’s
timezone) would be desired. In my case, I always like to think in local time:
I change my watch on every layover when traveling, for example. So if I’m in
Chicago borrowing a computer in the Admiral’s Club, I want to think in Central
Time, even though I’m based out of Los Angeles.

As long as it’s user-drivable, should work fine.

-jdOn Thu, 16 Dec 2004, Ian Daniel wrote:

Hi,

I would think that using a separate environment variable would be
better if it’s possible to get at it from the browser interface. You might
not want the timezone changed to that of the machine you’re borrowing for
example.

Regards,

–Ian

On 16 Dec 2004, at 13:15, Jason A. Diegmueller wrote:

Just a note, to anyone who develops something like this:

It would have to have an option to use the host OS’s current timezone, or
be easily (and I mean VERY easily) changble. I am on the road about 70% of
the time, and the last thing people in my situation need is another “time
zone” knob to remember to turn as they are travelling about.

Not everyone is always in the same spot.

Just something to think about. Regardless, if someone does create this, it
would be appreciate either way.

-jd

On Thu, 16 Dec 2004, Ian Daniel wrote:

Hi Rick ,

Thanks very much for the offer, I could use it now but I’ll be more
than happy to wait until you have time to fit it in after Christmas.

Regards,

–Ian

On 16 Dec 2004, at 05:21, Rick Measham wrote:

I’m one of the DateTime coders (http://datetime.perl.org) and would be
happy to write and contribute this functionality. Note that it will be
written using the DateTime libraries as these give the only accurate
time zone information available.
Ian: Do you need it before Christmas? Or can I get it to you by
new-year?
Cheers!
Rick
On Thu, 2004-12-16 at 15:38, Jesse Vincent wrote:

On Thu, Dec 16, 2004 at 01:06:34AM +0000, Ian Daniel wrote:

Hi,
I’m currently looking at implementing RT on a Solaris system and
have a question. We have multiple sites and it’d be nice to have
ticket
date/time information localised. So for example the Timezone on the
server is set to GB, but if a support person in Boston views the ticket
he sees the date and time the ticket was raised adjusted for his
Timezone. Is this possible? It’s possible in some commercial products
(Remedy does it) but I think you’d need to associate a Timezone with
each user account somehow and RT doesn’t seem to do that. Remedy uses
environment variables and its web client’s actually Java based.
Right. To do this, we’d need a per-user timezone setting. It’s not a lot
of code, but not something that anyone’s contributed code for or had us
do for them.
Best,
Jesse


The rt-users Archives
Be sure to check out the RT wiki at http://wiki.bestpractical.com


The rt-users Archives

Be sure to check out the RT wiki at http://wiki.bestpractical.com

Hi,

Well I managed to customise the user Preference and Modification pages  

to add a Timezone field and it’s created ok in the database (I thought
I’d try and do it as I had some spare time). All I did was add a text
field to each of the User Preference and User Modification schemas for
now. I probably need to think about auto generated users although they
could be given the system TZ I guess, or it could be left as NULL and
if it’s NULL $RT::Timezone gets returned? I know this isn’t a great way
to do it but it’s interesting to play around with it and if I actually
got it working it’d suit me for now.

mysql> describe Users;
| Field | Type | Null | Key | Default | Extra
|
| id | int(11) | | PRI | NULL |
auto_increment |
| Name | varchar(200) | | UNI | |
|
| Password | varchar(40) | YES | | NULL |
|
| Comments | blob | YES | | NULL |
|
| Signature | blob | YES | | NULL |
|
| EmailAddress | varchar(120) | YES | MUL | NULL |
|
| FreeformContactInfo | blob | YES | | NULL |
|
| Organization | varchar(200) | YES | | NULL |
|
| RealName | varchar(120) | YES | | NULL |
|
| NickName | varchar(16) | YES | | NULL |
|
| Lang | varchar(16) | YES | | NULL |
|
| EmailEncoding | varchar(16) | YES | | NULL |
|
| WebEncoding | varchar(16) | YES | | NULL |
|
| ExternalContactInfoId | varchar(100) | YES | | NULL |
|
| ContactInfoSystem | varchar(30) | YES | | NULL |
|
| ExternalAuthId | varchar(100) | YES | | NULL |
|
| AuthSystem | varchar(30) | YES | | NULL |
|
| Gecos | varchar(16) | YES | | NULL |
|
| HomePhone | varchar(30) | YES | | NULL |
|
| WorkPhone | varchar(30) | YES | | NULL |
|
| MobilePhone | varchar(30) | YES | | NULL |
|
| PagerPhone | varchar(30) | YES | | NULL |
|
| Address1 | varchar(200) | YES | | NULL |
|
| Address2 | varchar(200) | YES | | NULL |
|
| City | varchar(100) | YES | | NULL |
|
| State | varchar(100) | YES | | NULL |
|
| Zip | varchar(16) | YES | | NULL |
|
| Country | varchar(50) | YES | | NULL |
|
| Timezone | varchar(50) | YES | | NULL |
|
| PGPKey | text | YES | | NULL |
|
| Creator | int(11) | | | 0 |
|
| Created | datetime | YES | | NULL |
|
| LastUpdatedBy | int(11) | | | 0 |
|
| LastUpdated | datetime | YES | | NULL |
|

What I’m confused about now is the way to make RT use that variable.
The Date.pm file seems to return $RT::Timezone but also looks like it’s
geared up to take a value from the User property Timezone (bear with
me, I’m not good at perl). The code I think needs modifying is this.

sub LocalTimezone {
my $self = shift;

 return $self->CurrentUser->Timezone
     if $self->CurrentUser and $self->CurrentUser->can('Timezone');

 return ($RT::Timezone);

}

Which lives in lib/RT/Date.pm am I right? If I am I’ll persevere a bit
longer and try to learn a bit of perl :wink:

Thanks,

–IanOn 16 Dec 2004, at 13:15, Jason A. Diegmueller wrote:

Just a note, to anyone who develops something like this:

It would have to have an option to use the host OS’s current timezone,
or be easily (and I mean VERY easily) changble. I am on the road
about 70% of the time, and the last thing people in my situation need
is another “time zone” knob to remember to turn as they are travelling
about.

Not everyone is always in the same spot.

Just something to think about. Regardless, if someone does create
this, it would be appreciate either way.

-jd

On Thu, 16 Dec 2004, Ian Daniel wrote:

Hi Rick ,

Thanks very much for the offer, I could use it now but I’ll be more
than happy to wait until you have time to fit it in after Christmas.

Regards,

–Ian

On 16 Dec 2004, at 05:21, Rick Measham wrote:

I’m one of the DateTime coders (http://datetime.perl.org) and would
be
happy to write and contribute this functionality. Note that it will
be
written using the DateTime libraries as these give the only accurate
time zone information available.
Ian: Do you need it before Christmas? Or can I get it to you by
new-year?
Cheers!
Rick
On Thu, 2004-12-16 at 15:38, Jesse Vincent wrote:

On Thu, Dec 16, 2004 at 01:06:34AM +0000, Ian Daniel wrote:

Hi,
I’m currently looking at implementing RT on a Solaris system and
have a question. We have multiple sites and it’d be nice to have
ticket
date/time information localised. So for example the Timezone on the
server is set to GB, but if a support person in Boston views the
ticket
he sees the date and time the ticket was raised adjusted for his
Timezone. Is this possible? It’s possible in some commercial
products
(Remedy does it) but I think you’d need to associate a Timezone
with
each user account somehow and RT doesn’t seem to do that. Remedy
uses
environment variables and its web client’s actually Java based.
Right. To do this, we’d need a per-user timezone setting. It’s not
a lot
of code, but not something that anyone’s contributed code for or
had us
do for them.
Best,
Jesse


The rt-users Archives
Be sure to check out the RT wiki at http://wiki.bestpractical.com


The rt-users Archives

Be sure to check out the RT wiki at http://wiki.bestpractical.com

Hi,

Well I managed to customise the user Preference and
Modification pages to add a Timezone field and it’s created ok in the
database (I thought I’d try and do it as I had some spare time).

I’d strongly recommend using attributes to store user Timezone
preferences rather than altering the Users table schema.

Jesse

Oh,

Ok, I'll try and work out how to do that instead .... I've pretty much 

decided that the timezone info is being manipulated elsewhere anyway as
I can put absolutely anything in the code below instead of
$RT::Timezone and nothing changes. I also changed the Timezone in the
default config and still get the same date/time as I did before, I can
set it to EST, I get GB times, I can set it to anything, I still get GB
times.

sub LocalTimezone {
my $self = shift;

 return $self->CurrentUser->Timezone
     if $self->CurrentUser and $self->CurrentUser->can('Timezone');

 return ($RT::Timezone);

}

I’ll be interested to see what files change if and when it gets
implemented but I’m starting to think it wont be simple at all given
the fact that I don’t see the current timezone variable or anything
else actually doing what it’s supposed to do.

Hopefully I’m wrong.

–IanOn 16 Dec 2004, at 16:36, Jesse Vincent wrote:

On Thu, Dec 16, 2004 at 01:42:19PM +0000, Ian Daniel wrote:

Hi,

Well I managed to customise the user Preference and
Modification pages to add a Timezone field and it’s created ok in the
database (I thought I’d try and do it as I had some spare time).

I’d strongly recommend using attributes to store user Timezone
preferences rather than altering the Users table schema.

Jesse

Hi,

Ok, I've looked at this and have decided not to waste any more time. 

There is a Attributes table in the database that has no data in it at
all so I don’t see how it relates to the User in any way. Everything
else about the user is stored in the user table, language, name,
nickname, password etc etc. so I don’t really see why something like a
Timezone can’t go there, it’s way more useful than the fact someone
might call you “Chip”.

The major stumbling block I seem to have hit is the fact that your 

Timezone code doesn’t actually appear to work. I can set it to
anything, I get GMT, not actually a big deal in England but we wanted
to use this remotely from Boston and Canada. I simply can’t see how you
use Timezones in your code, there’s a passing nod to them in Date.pm,
but I can change the Timezone in the RT_SiteConfig.pm file to anything
(and I mean anything) I still get GMT. I can set it to US/Eastern I get
GMT displayed in my browser. I get GMT when I create a ticket.

Now I'm obviously missing something here ..... but I can't find it and 

without any real supporting documentation for it I’m never going to
find it. But what the hell, it’s not like I paid for it so if someone
implements the functionality I’ll be really happy.

Regards,

–IanOn 16 Dec 2004, at 16:36, Jesse Vincent wrote:

On Thu, Dec 16, 2004 at 01:42:19PM +0000, Ian Daniel wrote:

Hi,

Well I managed to customise the user Preference and
Modification pages to add a Timezone field and it’s created ok in the
database (I thought I’d try and do it as I had some spare time).

I’d strongly recommend using attributes to store user Timezone
preferences rather than altering the Users table schema.

Jesse