Jelly Widget UI page - Display date-time in the correct timezone

sylvain_hauser
Tera Contributor

Hi,

I am looking to display a message in an homepage for end user, such as:
"From (date-time) to (date-time), maintenance will be performed"

I successfully created a UI page, called by a widget that is now included in the homepage, but I have an issue with the date-time that is not shown in the correct time zone (eg.: if I change my timezone, the time is not changing)

Here is my jelly code:



<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g2:evaluate var="jvar_item" expression="gr = new GlideRecord('u_maintenance_message');gr.get('e26154b40a0a3c2c0084f0bb0bcffff8');var testDate = new
Packages.com.glide.glideobject.GlideDateTime(gr.u_start_date);
" />
<div><span style="color: rgb(255, 0, 0);">From $[gr.u_start_date] to $[gr.u_end_date], maintenance will be performed</span></div>
</j:jelly>


I also tried


<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g2:evaluate var="jvar_item" expression="gr = new GlideRecord('u_maintenance_message');gr.get('e26154b40a0a3c2c0084f0bb0bcffff8');var testDate1 = new
Packages.com.glide.glideobject.GlideDateTime(gr.u_start_date);var testDate2 = new
Packages.com.glide.glideobject.GlideDateTime(gr.u_end_date);
" />
<span style="color: rgb(255, 0, 0);">$[testDate1] to $[testDate2], maintenance will be performed</span></div>
</j:jelly>

wihtout success

Any idea?

Thanks a lot
Sylvain

5 REPLIES 5

thanks