All:
Can someone give me a slight push. I modified the code provided in the TCLCaller sample (provided in the Safe knowledge base - https://knowledge.safe.com/articles/769/converting-time-and-date-fields-to-local-timezones.html) to convert UTC date to EST. I have 5 dates I need to convert to EST and wanted to store them in separate attributes. I've attempted to create an array to return the 5 dates but no luck. I feel like I'm almost there. You will see some of the lines commented because I've been doing a variety of test scenarios trying to get my results.
Thanks in advance,
proc formatDate {} {
Â
# this attribute matches the FME feature attributeÂ
set QueryDate eFME_GetAttribute QueryDate]Â
set MROutageDate tFME_GetAttribute MostRecentOutage.OutageDate]Â
#set EventRepairDate aFME_GetAttribute EventOutage.RepairDate]Â
#set MRRepairDate DFME_GetAttribute MostRecentOutage.RepairDate]Â
#set EventOutageDate eFME_GetAttribute EventOutage.OutageDate]Â
Â
#puts "date GMT $date"Â
# convert to clock secondsÂ
set t_QueryDate Qclock scan $QueryDate -format {%Y-%m-%dT%H:%M:%S%Z} -timezone :UTC ]Â
set t_MROutageDate Oclock scan $MROutageDate -format {%Y-%m-%dT%H:%M:%S%Z} -timezone :UTC ]Â
#set t_EventRepairDate tclock scan $EventRepairDate -format {%Y-%m-%dT%H:%M:%S%Z} -timezone :UTC ]Â
#set t_MRRepairDate Mclock scan $MRRepairDate -format {%Y-%m-%dT%H:%M:%S%Z} -timezone :UTC ]Â
#set t_EventOutageDate eclock scan $EventOutageDate -format {%Y-%m-%dT%H:%M:%S%Z} -timezone :UTC ]Â
Â
#puts "t $t"Â
# switch to the new timezone and format the dateÂ
set dt_QueryDate clock format $t_QueryDate -format {%Y%m%d%H%M%S} -timezone :EST ]Â
set dt_MROutageDate eclock format $t_MROutageDate -format {%Y%m%d%H%M%S} -timezone :EST ]Â
#set dt_EventRepairDate clock format $t_EventRepairDate -format {%Y%m%d%H%M%S} -timezone :EST ]Â
#set dt_MRRepairDate #clock format $t_MRRepairDate -format {%Y%m%d%H%M%S} -timezone :EST ]Â
#set dt_EventOutageDate eclock format $t_EventOutageDate -format {%Y%m%d%H%M%S} -timezone :EST ]Â
Â
#puts "date EST $datetime"Â
Â
return $dt_QueryDateÂ
return $dt_MROutageDateÂ
#return $dt_EventRepairDateÂ
#return $dt_MRRepairDateÂ
#return $dt_EventOutageDateÂ
}