Requirements:
While working on a global implementation (Application Integrator
centrally located on a US machine) we had requirements to convert AI
generated date/time to local date/time. There were 3 different
components of the requirements:
i) Date/time conversion in the data segments.
ii) Date/time conversion in the envelopes of
X12/EDIFACT standards & 997/CONTROL messages.
iii) Many countries we were trying to implement also
had daylight saving system. Date/time conversion was required to take
this into account too.
Solution:
In order to fulfill above mentioned requirements we did following:
i) Defined a function in User.inc to calculate the
time zone (and if daylight saving on or not) of the machine running
AI. Although Trade Guide have a configuration to store the time zone,
it doesn't have any daylight saving aware settings (at least I don't
know about it).So we relied on EXECR and a small Unix script to know
the time-zone/daylight of the machine running AI.
ii) In the trade guide profile we created a custom
tab under partner profile which hold following values:
1. Country time zone. List of countries supported with time conversion.
2. If time/date conversion is required in enveloping model and
Acks. Yes/No.
iii) We defined another function in User.inc to
calculate local date/time. In this function date/time difference
between US time (say CST) and the regional time (say Australia). This
required us to hard code some values (like time difference and
daylight saving dates)
iv) For all data maps where local date/time is
required we asked our regional mapping teams to use this function
(defined in step iii) to convert AI generated date/time to local
date/time.
v) For enveloping/Ack models we copied
OT*Evp.mdl/OT*Ack.mdl into SCJ*Evp.mdl/SCJ*Ack.mdl and added the time
conversion function in there. Time conversion function in these models
is called only when the TP profile had "time/date conversion on
enveloping" set to yes.