Re: [rt-users] Date formatting

2014-10-15 Thread Emmanuel Lacour
Le 15/10/2014 10:40, Rinke Colen a écrit :
> 
> 
> OK, great. Problem is that my Perl knowledge is too small to fully
> understand the documentation on RT::Date or how to use the formatters
> it mentions. Could anyone give an example?
> 


$Ticket->CreatedObj->LocalizedDateTime( DateFormat =>
'date_format_full', TImeFormat => 'time_format_full', AbbrDay => 0,
AbbrMonth => 0, Timezone => 'user' );

Montag, 19. Mai 2014 16:04:29

is not far thant what you want


else you have to write a custom method ...

-- 
Easter-eggs  Spécialiste GNU/Linux
44-46 rue de l'Ouest  -  75014 Paris  -  France -  Métro Gaité
Phone: +33 (0) 1 43 35 00 37-   Fax: +33 (0) 1 43 35 00 76
mailto:elac...@easter-eggs.com  -   http://www.easter-eggs.com
-- 
RT Training November 4 & 5 Los Angeles
http://bestpractical.com/training


Re: [rt-users] Date formatting

2014-10-15 Thread Rinke Colen
On Wed, Oct 15, 2014 at 10:29 AM, Emmanuel Lacour
 wrote:
> Le 15/10/2014 10:21, Rinke Colen a écrit :
> > Does anyone know how to format the date/time that {$Ticket->Created}
> > returns in my email template? I want it to read "Wednesday October 8,
> > 2014 at 5:31 PM (CET)" or "Woensdag 8 oktober 2014 om 17:31 (CET)".
> > (Second version is Dutch.)
>
> Use $Ticket->CreatedObj instead of $Ticket->Created, this will give you
> an RT::Date object. Then look at lib/RT/Date.pm there is many formatting
> methods. If none suit your needs, you can "easily" write new one in
> local/lib/RT/Date_Local.pm

OK, great. Problem is that my Perl knowledge is too small to fully
understand the documentation on RT::Date or how to use the formatters
it mentions. Could anyone give an example?
-- 
RT Training November 4 & 5 Los Angeles
http://bestpractical.com/training


Re: [rt-users] Date formatting

2014-10-15 Thread Emmanuel Lacour
Le 15/10/2014 10:21, Rinke Colen a écrit :
> Does anyone know how to format the date/time that {$Ticket->Created}
> returns in my email template? I want it to read "Wednesday October 8,
> 2014 at 5:31 PM (CET)" or "Woensdag 8 oktober 2014 om 17:31 (CET)".
> (Second version is Dutch.)
> 


Use $Ticket->CreatedObj instead of $Ticket->Created, this will give you
an RT::Date object. Then look at lib/RT/Date.pm there is many formatting
methods. If none suit your needs, you can "easily" write new one in
local/lib/RT/Date_Local.pm


-- 
Easter-eggs  Spécialiste GNU/Linux
44-46 rue de l'Ouest  -  75014 Paris  -  France -  Métro Gaité
Phone: +33 (0) 1 43 35 00 37-   Fax: +33 (0) 1 43 35 00 76
mailto:elac...@easter-eggs.com  -   http://www.easter-eggs.com
-- 
RT Training November 4 & 5 Los Angeles
http://bestpractical.com/training


Re: [rt-users] Date formatting

2014-10-15 Thread Christian Loos
Am 15.10.2014 um 10:21 schrieb Rinke Colen:
> Does anyone know how to format the date/time that {$Ticket->Created}
> returns in my email template? I want it to read "Wednesday October 8,
> 2014 at 5:31 PM (CET)" or "Woensdag 8 oktober 2014 om 17:31 (CET)".
> (Second version is Dutch.)
> 
> Rinke Colen
> CTO
> LinkedIn  | email
> 
> 
> experty®
> t: +31 (0)88 520 77 77
> w: experty.com 

{$Ticket->CreatedObj->AsString()}

Chris
-- 
RT Training November 4 & 5 Los Angeles
http://bestpractical.com/training


Re: [rt-users] Date formatting

2014-10-15 Thread Rinke Colen
Does anyone know how to format the date/time that {$Ticket->Created}
returns in my email template? I want it to read "Wednesday October 8, 2014
at 5:31 PM (CET)" or "Woensdag 8 oktober 2014 om 17:31 (CET)". (Second
version is Dutch.)

Rinke Colen
CTO
LinkedIn  | email


experty®
t: +31 (0)88 520 77 77
w: experty.com 

On Thu, Oct 9, 2014 at 2:03 PM, Rinke Colen  wrote:

> Thanks. I'm afraid I still don't understand what to do however. I looked
> at the links but the two threads don't really apply to my situation and the
> RT::Date documentation is too general for me to be able to translate it
> into a solution, with my limited knowledge of Perl. It clearly has
> something to do with "Output formatters" but I don't understand how to use
> them.
>
> If it's not too much to ask, then what would really help me is to see some
> code that could replace {$Ticket->Created} to yield the output I need.
>
> Rinke
>
>
> On Wed, Oct 8, 2014 at 10:53 PM, Joop  wrote:
>
>> On 8-10-2014 17:55, Rinke Colen wrote:
>> > I want to mention the ticket creation date in an auto reply. I use the
>> > following code snippet in my email template: {$Ticket->Created}. This
>> > produces the string "2014-10-08 15:31:24" (UTC) but I want to show
>> > "October 8, 2014 at 5:31 PM" (CET) is one place and "8 oktober 2014 om
>> > 17:31" in another place. (The word "oktober" in the second string is
>> > Dutch.) How can I format the timestamps?
>> >
>> Have look at the following 3 links:
>> http://bestpractical.com/docs/rt/4.2/RT/Date.html
>> http://www.gossamer-threads.com/lists/rt/users/52528
>> http://www.gossamer-threads.com/lists/rt/users/15445
>>
>> > On a procedural note: I'm not sure if this question conforms to
>> > requirements of this mailing list. I have searched the history of this
>> > list since I joined for an answer, but don't know where to find the rest
>> > of the history. Also I know very little about Perl. I'm slightly worried
>> > that my question is too "dumb". But I have many more of these newbie
>> > questions. Can I just ask them here? (I.e. if I don't find the answer in
>> > the mailing list history, the documentation on bestpractical.com
>> >  or on the the wiki.)
>> >
>> I'll help any Dutchmen anytime :-)
>>
>> Regards,
>>
>> Joop
>
>
-- 
RT Training November 4 & 5 Los Angeles
http://bestpractical.com/training


Re: [rt-users] Date formatting

2014-10-09 Thread Rinke Colen
Thanks. I'm afraid I still don't understand what to do however. I looked at
the links but the two threads don't really apply to my situation and the
RT::Date documentation is too general for me to be able to translate it
into a solution, with my limited knowledge of Perl. It clearly has
something to do with "Output formatters" but I don't understand how to use
them.

If it's not too much to ask, then what would really help me is to see some
code that could replace {$Ticket->Created} to yield the output I need.

Rinke


On Wed, Oct 8, 2014 at 10:53 PM, Joop  wrote:

> On 8-10-2014 17:55, Rinke Colen wrote:
> > I want to mention the ticket creation date in an auto reply. I use the
> > following code snippet in my email template: {$Ticket->Created}. This
> > produces the string "2014-10-08 15:31:24" (UTC) but I want to show
> > "October 8, 2014 at 5:31 PM" (CET) is one place and "8 oktober 2014 om
> > 17:31" in another place. (The word "oktober" in the second string is
> > Dutch.) How can I format the timestamps?
> >
> Have look at the following 3 links:
> http://bestpractical.com/docs/rt/4.2/RT/Date.html
> http://www.gossamer-threads.com/lists/rt/users/52528
> http://www.gossamer-threads.com/lists/rt/users/15445
>
> > On a procedural note: I'm not sure if this question conforms to
> > requirements of this mailing list. I have searched the history of this
> > list since I joined for an answer, but don't know where to find the rest
> > of the history. Also I know very little about Perl. I'm slightly worried
> > that my question is too "dumb". But I have many more of these newbie
> > questions. Can I just ask them here? (I.e. if I don't find the answer in
> > the mailing list history, the documentation on bestpractical.com
> >  or on the the wiki.)
> >
> I'll help any Dutchmen anytime :-)
>
> Regards,
>
> Joop
-- 
RT Training November 4 & 5 Los Angeles
http://bestpractical.com/training


Re: [rt-users] Date formatting

2014-10-08 Thread Joop
On 8-10-2014 17:55, Rinke Colen wrote:
> I want to mention the ticket creation date in an auto reply. I use the
> following code snippet in my email template: {$Ticket->Created}. This
> produces the string "2014-10-08 15:31:24" (UTC) but I want to show
> "October 8, 2014 at 5:31 PM" (CET) is one place and "8 oktober 2014 om
> 17:31" in another place. (The word "oktober" in the second string is
> Dutch.) How can I format the timestamps?
> 
Have look at the following 3 links:
http://bestpractical.com/docs/rt/4.2/RT/Date.html
http://www.gossamer-threads.com/lists/rt/users/52528
http://www.gossamer-threads.com/lists/rt/users/15445

> On a procedural note: I'm not sure if this question conforms to
> requirements of this mailing list. I have searched the history of this
> list since I joined for an answer, but don't know where to find the rest
> of the history. Also I know very little about Perl. I'm slightly worried
> that my question is too "dumb". But I have many more of these newbie
> questions. Can I just ask them here? (I.e. if I don't find the answer in
> the mailing list history, the documentation on bestpractical.com
>  or on the the wiki.)
> 
I'll help any Dutchmen anytime :-)

Regards,

Joop



-- 
RT Training November 4 & 5 Los Angeles
http://bestpractical.com/training


[rt-users] Date formatting

2014-10-08 Thread Rinke Colen
I want to mention the ticket creation date in an auto reply. I use the
following code snippet in my email template: {$Ticket->Created}. This
produces the string "2014-10-08 15:31:24" (UTC) but I want to show "October
8, 2014 at 5:31 PM" (CET) is one place and "8 oktober 2014 om 17:31" in
another place. (The word "oktober" in the second string is Dutch.) How can
I format the timestamps?

On a procedural note: I'm not sure if this question conforms to
requirements of this mailing list. I have searched the history of this list
since I joined for an answer, but don't know where to find the rest of the
history. Also I know very little about Perl. I'm slightly worried that my
question is too "dumb". But I have many more of these newbie questions. Can
I just ask them here? (I.e. if I don't find the answer in the mailing list
history, the documentation on bestpractical.com or on the the wiki.)

Rinke
-- 
RT Training November 4 & 5 Los Angeles
http://bestpractical.com/training