<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Incorrect TimeZone error in Salesforce-Talend integration, how to correct timezone? in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Incorrect-TimeZone-error-in-Salesforce-Talend-integration-how-to/m-p/2241939#M28927</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt; 
&lt;P&gt;I am using Talend Big Data 7.3 version.&lt;/P&gt; 
&lt;P&gt;I have data coming from Salesforce. The data includes one column - AppointmentDate. After I retrieve the data in the talend job, its printing the date in UTC time format. I checked the Salesforce user account confirguration and its set to EDT timezone. So, when I see the same data in Salesforce report its in EDT timezone. But that same date in talend job, its showing UTC time.&lt;/P&gt; 
&lt;P&gt;So, I wrote a method to convert the UTC to EDT timezone. I wrote a routine method and called it on the column using a tmap. But when I print the input date from Salesforce in my method, its showing EDT timezone.&lt;/P&gt; 
&lt;P&gt;Below is the method I wrote:&lt;/P&gt; 
&lt;PRE&gt;public synchronized static String formatDateUTCtoEST(java.util.Date dateVal) {
    	if(dateVal != null) {
    	System.out.println("Actual Date: "+dateVal);
        
    	  DateFormat estFormat = new SimpleDateFormat();
    	  DateFormat gmtFormat = new SimpleDateFormat();
    	  TimeZone gmtTime = TimeZone.getTimeZone("GMT");
    	  TimeZone estTime = TimeZone.getTimeZone("EST");
    	  estFormat.setTimeZone(gmtTime);
    	  gmtFormat.setTimeZone(estTime);
    	  System.out.println("GMT Time: " + estFormat.format(dateVal));
    	  System.out.println("EST Time: " + gmtFormat.format(dateVal));
    	  return gmtFormat.format(dateVal);
    	}  
    	return "No Appointment Set";
    }&lt;/PRE&gt; 
&lt;P&gt;The output I am getting:&lt;/P&gt; 
&lt;PRE&gt;Actual Date: Mon Jun 08 13:00:00 EDT 2020
GMT Time: 6/8/20 5:00 PM
EST Time: 6/8/20 12:00 PM&lt;/PRE&gt; 
&lt;P&gt;But, In Salesforce report the Appointment Date is 6/8/2020 9:00 AM.&lt;/P&gt; 
&lt;P&gt;Also, when I print the date in my method first, its showing EDT, which is actually UTC. And if I convert in my method then its taking the time in EDT and doing incorrect calculations.&lt;/P&gt; 
&lt;P&gt;Please help, how can I correct the timezone in my appointment date field.&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 02:29:41 GMT</pubDate>
    <dc:creator>dattasud</dc:creator>
    <dc:date>2024-11-16T02:29:41Z</dc:date>
    <item>
      <title>Incorrect TimeZone error in Salesforce-Talend integration, how to correct timezone?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Incorrect-TimeZone-error-in-Salesforce-Talend-integration-how-to/m-p/2241939#M28927</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt; 
&lt;P&gt;I am using Talend Big Data 7.3 version.&lt;/P&gt; 
&lt;P&gt;I have data coming from Salesforce. The data includes one column - AppointmentDate. After I retrieve the data in the talend job, its printing the date in UTC time format. I checked the Salesforce user account confirguration and its set to EDT timezone. So, when I see the same data in Salesforce report its in EDT timezone. But that same date in talend job, its showing UTC time.&lt;/P&gt; 
&lt;P&gt;So, I wrote a method to convert the UTC to EDT timezone. I wrote a routine method and called it on the column using a tmap. But when I print the input date from Salesforce in my method, its showing EDT timezone.&lt;/P&gt; 
&lt;P&gt;Below is the method I wrote:&lt;/P&gt; 
&lt;PRE&gt;public synchronized static String formatDateUTCtoEST(java.util.Date dateVal) {
    	if(dateVal != null) {
    	System.out.println("Actual Date: "+dateVal);
        
    	  DateFormat estFormat = new SimpleDateFormat();
    	  DateFormat gmtFormat = new SimpleDateFormat();
    	  TimeZone gmtTime = TimeZone.getTimeZone("GMT");
    	  TimeZone estTime = TimeZone.getTimeZone("EST");
    	  estFormat.setTimeZone(gmtTime);
    	  gmtFormat.setTimeZone(estTime);
    	  System.out.println("GMT Time: " + estFormat.format(dateVal));
    	  System.out.println("EST Time: " + gmtFormat.format(dateVal));
    	  return gmtFormat.format(dateVal);
    	}  
    	return "No Appointment Set";
    }&lt;/PRE&gt; 
&lt;P&gt;The output I am getting:&lt;/P&gt; 
&lt;PRE&gt;Actual Date: Mon Jun 08 13:00:00 EDT 2020
GMT Time: 6/8/20 5:00 PM
EST Time: 6/8/20 12:00 PM&lt;/PRE&gt; 
&lt;P&gt;But, In Salesforce report the Appointment Date is 6/8/2020 9:00 AM.&lt;/P&gt; 
&lt;P&gt;Also, when I print the date in my method first, its showing EDT, which is actually UTC. And if I convert in my method then its taking the time in EDT and doing incorrect calculations.&lt;/P&gt; 
&lt;P&gt;Please help, how can I correct the timezone in my appointment date field.&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 02:29:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Incorrect-TimeZone-error-in-Salesforce-Talend-integration-how-to/m-p/2241939#M28927</guid>
      <dc:creator>dattasud</dc:creator>
      <dc:date>2024-11-16T02:29:41Z</dc:date>
    </item>
  </channel>
</rss>

