Home
Analytics
Convert from GMT to Local Time
kpelzer29
There are some dates stored in a database in GMT and need to be displayed in a report in the Eastern time zone representation. Is there a way to convert a date from GMT to Eastern time zone representation (taking into account daylight savings time when applicable)?
Also, is there a way to convert a date from GMT to the local time zone repesentation?
Find more posts tagged with
Comments
mwilliams
Changing from GMT to eastern time should be pretty simple. You'd just use the BirtDateTime.addHour() function to change the hours. As for EDT vs EST, you'd just adjust the amount you change the time by by an hour when in DST.
When you're talking local time zone, do you mean for the end user?
mcremer
<blockquote class='ipsBlockquote' data-author="'kpelzer29'" data-cid="80090" data-time="1310660001" data-date="14 July 2011 - 09:13 AM"><p>
There are some dates stored in a database in GMT and need to be displayed in a report in the Eastern time zone representation. Is there a way to convert a date from GMT to Eastern time zone representation (taking into account daylight savings time when applicable)? <br />
<br />
Also, is there a way to convert a date from GMT to the local time zone repesentation?<br /></p></blockquote>
You can use the Simple Date formater even if needed it is probebly the same as the Birtfucntion.<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
dfy = new Packages.java.text.SimpleDateFormat("yyyy");
DateFormat firstFormat = new Packages.java.text.SimpleDateFormat();
DateFormat secondFormat = new Packages.java.text.SimpleDateFormat();
TimeZone firstTime = new Packages.java.util.TimeZone.getTimeZone("GMT");
TimeZone secondTime = new Packages.java.util.TimeZone.getTimeZone("GMT-8");
firstFormat.setTimeZone(firstTime);
secondFormat.setTimeZone(secondTime);
date = pdataSetRow["DATE"];
firstFormat.format(date);
secondFormat.format(date);
</pre>
yoovrajkhullar
<blockquote class="ipsBlockquote" data-author="mwilliams" data-cid="80100" data-time="1310671855">
<div>
<p>Changing from GMT to eastern time should be pretty simple. You'd just use the BirtDateTime.addHour() function to change the hours. As for EDT vs EST, you'd just adjust the amount you change the time by by an hour when in DST. When you're talking local time zone, do you mean for the end user?</p>
</div>
</blockquote>
<p>Yes Michael,</p>
<p>How to change GMT Timezone to End User Time zone.</p>
<p>Thanks</p>
<p>Raj</p>
yoovrajkhullar
<blockquote class="ipsBlockquote" data-author="mcremer" data-cid="80111" data-time="1310724162">
<div>
<p>You can use the Simple Date formater even if needed it is probebly the same as the Birtfucntion.<br>
</p>
<pre class="_prettyXprint _lang-auto _linenums:0">
dfy = new Packages.java.text.SimpleDateFormat("yyyy");
DateFormat firstFormat = new Packages.java.text.SimpleDateFormat();
DateFormat secondFormat = new Packages.java.text.SimpleDateFormat();
TimeZone firstTime = new Packages.java.util.TimeZone.getTimeZone("GMT");
TimeZone secondTime = new Packages.java.util.TimeZone.getTimeZone("GMT-8");
firstFormat.setTimeZone(firstTime);
secondFormat.setTimeZone(secondTime);
date = pdataSetRow["DATE"];
firstFormat.format(date);
secondFormat.format(date);
</pre>
</div>
</blockquote>
<p> </p>
<blockquote class="ipsBlockquote" data-author="mcremer" data-cid="80111" data-time="1310724162">
<div>
<p>You can use the Simple Date formater even if needed it is probebly the same as the Birtfucntion.<br>
</p>
<pre class="_prettyXprint _lang-auto _linenums:0">
dfy = new Packages.java.text.SimpleDateFormat("yyyy");
DateFormat firstFormat = new Packages.java.text.SimpleDateFormat();
DateFormat secondFormat = new Packages.java.text.SimpleDateFormat();
TimeZone firstTime = new Packages.java.util.TimeZone.getTimeZone("GMT");
TimeZone secondTime = new Packages.java.util.TimeZone.getTimeZone("GMT-8");
firstFormat.setTimeZone(firstTime);
secondFormat.setTimeZone(secondTime);
date = pdataSetRow["DATE"];
firstFormat.format(date);
secondFormat.format(date);
</pre>
</div>
</blockquote>
<p>Hi </p>
<p>I want the GMT to be converted into Actuate Portal Time Zone i.e End User Time Zone, not just America/New_York Time Zone, i.e GMT-8 etc.</p>