On Wed, Feb 12, 2014 at 10:54:17AM -0800, j.hubbard wrote: > I have a DateTime Custom field called "Effective". The value of this field > is sent out in emails on ticket creation. > > So far I have changed settings in RT_SiteConfig for $DateTimeFormat and > $DateDayBeforeMonth but those don't affect the output in emails at all.
Those change RT's display of dates. They're not going to change
custom code that you write.
> *Effective:* {$Ticket->FirstCustomFieldValue('Effective');}<br>
FirstCustomFieldValue returns the raw value of the custom field.
If you want it formatted, you need to use RT::Date.
Here is how the web frontend does it.
https://github.com/bestpractical/rt/blob/stable/share/html/Elements/ShowCustomFieldDate#L49
$Object->Content is basically the same for you as what you get back
from FirstCustomFieldValue.
Read about RT::Date here
http://bestpractical.com/docs/rt/latest/RT/Date.html
You're probably most concerned with the Output formatters so you
either override or use the one you specified in the config.
-kevin
pgprV3xwfJckL.pgp
Description: PGP signature
-- RT Training London, March 19-20 and Dallas May 20-21 http://bestpractical.com/training
