Publishing activation date for different Time Zones in XML
Moderators: chulett, rschirm, roy
Publishing activation date for different Time Zones in XML
I have XML job which extracts data from Sybase server and publishes it to the XML file. Now we display date/time field in EST time, but for some
companies we need to display date/time filed converting to a different time zone. I reviewed DataStage Date functions, but didn't find any which I can use. Please advise.
Thank you,
Alla
companies we need to display date/time filed converting to a different time zone. I reviewed DataStage Date functions, but didn't find any which I can use. Please advise.
Thank you,
Alla
My Requirement was convert EST to GMT. This is a sample code used for particular task.
Input
Date : YYYYMMDD
Time : HH:MI:SS (24 hour clock)
Zone : EST
output : Corresponding GMT value
YYYY-MM-DD HH:MI:SS
* This routine will convert given date/time according to the given time zone
* Output will be corresponding GMT time
vTime = iconv(pTime,"MTS")
*Default Value for output
yyyy=pDate[1,4]
mm=pDate[5,2]
dd=pDate[7,2]
vDate=dd:'/':mm:'/':yyyy
*Output Date format
oDate = yyyy:'-':mm:'-':dd
Ans=oDate:' ' :pTime
* Assumption EST = GMT - 5
if pZone = 'EST' then
if vTime < 19 * 60 * 60 Then
vTime = oconv(vTime + (5 * 60 * 60),"MTS")
vDate = oConv(oDate,"D-YMD[4,2,2]")
end
else
vTime = oconv(vTime + (5 * 60 * 60),"MTS")
vDate = Iconv(pDate, "D/E") + 1
vDate = oConv(vDate,"D-YMD[4,2,2]")
end
Ans = vDate:' ':vTime
end
Input
Date : YYYYMMDD
Time : HH:MI:SS (24 hour clock)
Zone : EST
output : Corresponding GMT value
YYYY-MM-DD HH:MI:SS
* This routine will convert given date/time according to the given time zone
* Output will be corresponding GMT time
vTime = iconv(pTime,"MTS")
*Default Value for output
yyyy=pDate[1,4]
mm=pDate[5,2]
dd=pDate[7,2]
vDate=dd:'/':mm:'/':yyyy
*Output Date format
oDate = yyyy:'-':mm:'-':dd
Ans=oDate:' ' :pTime
* Assumption EST = GMT - 5
if pZone = 'EST' then
if vTime < 19 * 60 * 60 Then
vTime = oconv(vTime + (5 * 60 * 60),"MTS")
vDate = oConv(oDate,"D-YMD[4,2,2]")
end
else
vTime = oconv(vTime + (5 * 60 * 60),"MTS")
vDate = Iconv(pDate, "D/E") + 1
vDate = oConv(vDate,"D-YMD[4,2,2]")
end
Ans = vDate:' ':vTime
end
Thanks,
Upul
Upul
Hi Upul,uegodawa wrote:My Requirement was convert EST to GMT. This is a sample code used for particular task.
* Assumption EST = GMT - 5
if pZone = 'EST' then
if vTime < 19 * 60 * 60 Then
vTime = oconv(vTime + (5 * 60 * 60),"MTS")
vDate = oConv(oDate,"D-YMD[4,2,2]")
end
else
vTime = oconv(vTime + (5 * 60 * 60),"MTS")
vDate = Iconv(pDate, "D/E") + 1
vDate = oConv(vDate,"D-YMD[4,2,2]")
end
Ans = vDate:' ':vTime
end
Thank you for your help.
Our task is to be able to convert to any Time Zone.
We cannot hard code assumptions for the time difference, because of Daylight Saving Time.
Alla