current-dateTime() in Orbeon form

27 views
Skip to first unread message

Chunyu

unread,
Jul 14, 2015, 12:18:45 PM7/14/15
to orb...@googlegroups.com
Hello,

We are facing a strange behaviour of Orbeon form.

The result of current-dateTime() is different with different environment.

We only have a simple output like <xf:output value="current-dateTime()"/>.

It is working fine with one environment and it outputs same as the machine time.
However, it outputs with a different timeZone at other environment that machine has been set as BST. But the output of current-dateTime is American time.

Both environments have the same code.

Please advise.

Thanks,
Chunyu

Alessandro Vernet

unread,
Jul 15, 2015, 2:03:40 AM7/15/15
to orb...@googlegroups.com
Hi Chunyu,

Would you have an example of what the out of the current-dateTime() is on
both environments?

Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
View this message in context: http://discuss.orbeon.com/current-dateTime-in-Orbeon-form-tp4660243p4660245.html
Sent from the Orbeon Forms community mailing list mailing list archive at Nabble.com.

Chunyu Cong

unread,
Jul 15, 2015, 3:49:43 AM7/15/15
to orb...@googlegroups.com
Hi Alex,

I used current-dateTime() in a test form of form builder from both environments.
They have exactly same code.

Please see the four screen shots with the outputs and machine time each.

Thanks,
Chunyu



--
You received this message because you are subscribed to a topic in the Google Groups "Orbeon Forms" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/orbeon/X1UFT5a4FuA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to orbeon+un...@googlegroups.com.
To post to this group, send email to orb...@googlegroups.com.

2015-07-15_0845_local.png
2015-07-15_0844_local.png
2015-07-15_0843_dev.png
2015-07-15_0842_dev.png

Alessandro Vernet

unread,
Jul 15, 2015, 7:28:01 PM7/15/15
to orb...@googlegroups.com
Hi Chunyu,

Got it. I suspect that this is because you have a different user timezone
set on those 2 machines. For instance, on my computer, out of the box I get
a time in PDT, my local timezone:

2015-07-15T16:23:09.787-07:00

But if I add the following flag to the JVM -Duser.timezone=Australia/Sydney,
I'll get the time in the timezone for Sydney.

2015-07-16T09:20:57.608+10:00

If you want to get a consistent time across servers, you might want to
explicitly set -Duser.timezone to the same value on those different servers.

Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
View this message in context: http://discuss.orbeon.com/current-dateTime-in-Orbeon-form-tp4660243p4660252.html
Reply all
Reply to author
Forward
0 new messages