Server Time & Lucee Time

Hey guys,

While I’m not to worried about it, I noticed this week that on the Lucee
Admin Regional page that the times were the same. This is not the case!
The server is set to use UTC and on the Regional page we have Lucee set to
use US/Central. Both times are showing US/Central.

Anyone know why this is happening? We are running Lucee 5.0.1.67-SNAPSHOT
on a linux box. Any thoughts or help would be appreciated.

Thanks!

Hi,

I’m not seeing this on my server. I have the server set to BST and for one
particular site it is set to Australia/Sydney and showing correctly:

[image: Inline images 1]

Are you 100% sure the server is set to UTC? If you type date at the command
prompt it will show you.

Kind regards,

Andrew
about.me http://about.me/andrew_dixon - mso http://www.mso.net - Lucee
Association Member http://lucee.orgOn 20 October 2016 at 14:49, W. Williams <@W_Williams> wrote:

Hey guys,

While I’m not to worried about it, I noticed this week that on the Lucee
Admin Regional page that the times were the same. This is not the case!
The server is set to use UTC and on the Regional page we have Lucee set to
use US/Central. Both times are showing US/Central.

Anyone know why this is happening? We are running Lucee 5.0.1.67-SNAPSHOT
on a linux box. Any thoughts or help would be appreciated.

Thanks!


Get 10% off of the regular price for this years CFCamp in Munich, Germany
(Oct. 20th & 21st) with the Lucee discount code Lucee@cfcamp. 189€
instead of 210€. Visit https://ti.to/cfcamp/cfcamp-
2016/discount/Lucee@cfcamp

You received this message because you are subscribed to the Google Groups
“Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/
msgid/lucee/7c6acce3-8188-49d0-bafc-3479bfe48f49%40googlegroups.com
https://groups.google.com/d/msgid/lucee/7c6acce3-8188-49d0-bafc-3479bfe48f49%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

After a few weeks of playing, we have 4 servers all with this issue. When typing date in the terminal, it is set to UTC. We have tripple checked this on all servers.

We are using US / Central Time as the Lucee time. Within the Lucee Admin, both times are the same.

Where does Lucee pull the server time from? Anyone have any thoughts? Concerned about the time change this weekend.

Try this code:

Server Date/Time: #lsdateFormat(date:now(),timezone:“jvm”)#
#lstimeFormat(time:now(),timezone:“jvm”)#

Lucee Date/Time: #lsdateFormat(date:now())#
#lstimeFormat(time:now())#

JVM(System) Timezone:
#createobject(“java”,“java.util.TimeZone”).getDefault().getId()#

PageContext(Lucee) Timezone: #getPageContext().getTimeZone()#

The first two outputted lines is exactly what the overview.cfm in the
administrator does. Note Lucee uses date/timeformat without a timezone, so
whatever is in PageContext (administrator) stands. The System time uses
the JVM’s timezone.

That means if you’re changing the JVM’s timezone with the TZ variable or
-Duser.timezone… the “System” time will be in whatever the JVM has been
told to use. (Regardless of what the date command says)

JoeOn Fri, Nov 4, 2016 at 7:36 AM, Joseph Gooch <@Joseph_Gooch> wrote:

If you’re concerned about the time change, can’t you temporarily change
the clock on one of the servers and verify Lucee responds properly?

Joe

On Fri, Nov 4, 2016 at 7:34 AM, Joseph Gooch <@Joseph_Gooch> wrote:

When you start lucee, do you set the TZ environment variable?

For instance, on my mac:
$ date
Fri Nov 4 07:30:50 EDT 2016

$ env TZ=US/Central date
Fri Nov 4 06:30:54 CDT 2016

POSIX OS’s will auto-translate if the TZ variable is set. If it’s not
set, it’ll use whatever /etc/localtime says, which I’m guessing in your
case is UTC.

Related/supporting info
java - How to set a JVM TimeZone Properly - Stack Overflow
jvm-timezone-properly

I’m not sure what Lucee does internally to show that information.

Joe

On Fri, Nov 4, 2016 at 1:52 AM, W. Williams <@W_Williams> wrote:

After a few weeks of playing, we have 4 servers all with this issue.
When typing date in the terminal, it is set to UTC. We have tripple
checked this on all servers.

We are using US / Central Time as the Lucee time. Within the Lucee
Admin, both times are the same.

Where does Lucee pull the server time from? Anyone have any thoughts?
Concerned about the time change this weekend.


Get 10% off of the regular price for this years CFCamp in Munich,
Germany (Oct. 20th & 21st) with the Lucee discount code Lucee@cfcamp.
189€ instead of 210€. Visit https://ti.to/cfcamp/cfcamp-20
16/discount/Lucee@cfcamp

You received this message because you are subscribed to the Google
Groups “Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send
an email to lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/ms
gid/lucee/1c2de94e-a855-4d2c-b6a6-3ee250a7ac3d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

When you start lucee, do you set the TZ environment variable?

For instance, on my mac:
$ date
Fri Nov 4 07:30:50 EDT 2016

$ env TZ=US/Central date
Fri Nov 4 06:30:54 CDT 2016

POSIX OS’s will auto-translate if the TZ variable is set. If it’s not set,
it’ll use whatever /etc/localtime says, which I’m guessing in your case is
UTC.

Related/supporting info

I’m not sure what Lucee does internally to show that information.

JoeOn Fri, Nov 4, 2016 at 1:52 AM, W. Williams <@W_Williams> wrote:

After a few weeks of playing, we have 4 servers all with this issue. When
typing date in the terminal, it is set to UTC. We have tripple checked
this on all servers.

We are using US / Central Time as the Lucee time. Within the Lucee Admin,
both times are the same.

Where does Lucee pull the server time from? Anyone have any thoughts?
Concerned about the time change this weekend.


Get 10% off of the regular price for this years CFCamp in Munich, Germany
(Oct. 20th & 21st) with the Lucee discount code Lucee@cfcamp. 189€
instead of 210€. Visit https://ti.to/cfcamp/cfcamp-
2016/discount/Lucee@cfcamp

You received this message because you are subscribed to the Google Groups
“Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/
msgid/lucee/1c2de94e-a855-4d2c-b6a6-3ee250a7ac3d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

If you go to the lucee admin you should see the time server:> On 4 Nov 2016, at 05:52, W. Williams <@W_Williams> wrote:

Where does Lucee pull the server time from? Anyone have any thoughts? Concerned about the time change this weekend.

If you’re concerned about the time change, can’t you temporarily change the
clock on one of the servers and verify Lucee responds properly?

JoeOn Fri, Nov 4, 2016 at 7:34 AM, Joseph Gooch <@Joseph_Gooch> wrote:

When you start lucee, do you set the TZ environment variable?

For instance, on my mac:
$ date
Fri Nov 4 07:30:50 EDT 2016

$ env TZ=US/Central date
Fri Nov 4 06:30:54 CDT 2016

POSIX OS’s will auto-translate if the TZ variable is set. If it’s not set,
it’ll use whatever /etc/localtime says, which I’m guessing in your case is
UTC.

Related/supporting info
java - How to set a JVM TimeZone Properly - Stack Overflow
a-jvm-timezone-properly

I’m not sure what Lucee does internally to show that information.

Joe

On Fri, Nov 4, 2016 at 1:52 AM, W. Williams <@W_Williams> wrote:

After a few weeks of playing, we have 4 servers all with this issue. When
typing date in the terminal, it is set to UTC. We have tripple checked
this on all servers.

We are using US / Central Time as the Lucee time. Within the Lucee
Admin, both times are the same.

Where does Lucee pull the server time from? Anyone have any thoughts?
Concerned about the time change this weekend.


Get 10% off of the regular price for this years CFCamp in Munich, Germany
(Oct. 20th & 21st) with the Lucee discount code Lucee@cfcamp. 189€
instead of 210€. Visit https://ti.to/cfcamp/cfcamp-20
16/discount/Lucee@cfcamp

You received this message because you are subscribed to the Google Groups
“Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/ms
gid/lucee/1c2de94e-a855-4d2c-b6a6-3ee250a7ac3d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Joe,

So I looked in all the tomcat configs and I found nothing. I might have
just found the issue / reason. I ran your <cfdump
var=“#createobject(“java”,“java.lang.System”).getProperties()#” /> and it
shows “user.timezone string UTC”. So not set anywhere there (Trust me, I
was pulling out my hair).

Then it hit me:

I went back and looked at the previous posts and noticed that all screen
grabs were from the web admin and NOT the server admin. All the sites on
these servers belong to our company and we don’t use any site specific
settings, they are all Lucee server settings. Is the Lucess server admin
setting a global time and that is what is being displayed as the “Server
Time”? If I change the server TZ setting in the server admin to UTC it
changes the Lucee time to UTC but Server time stays on US/Central. If I
reboot the box will it change the server time too (NOTE: This is a box that
is in production and a reboot is not possible at this moment)?

Thx Joe! Ok, I ran the code and here is what I got:

Server Date/Time: Nov 4, 2016 8:08 AM
Lucee Date/Time: Nov 4, 2016 8:08 AM
JVM(System) Timezone: US/Central
PageContext(Lucee) Timezone: US/Central

As you thought, the JVM is using US/Central. The issue is that I am not
defining this anywhere. I’m launching lucee and Apache using the rc.local
in the /etc/rc.d/ directory with /sbin/service railo_ctl start command.

The Lucee config is set to US/Central and that is the only setting I have
changed. Running date from the terminal on the server shows:

Fri Nov 4 13:08:41 UTC 2016

How can I correct this? Is there a setting in the server.xml or web.xml I
should be seeing. I have looked and I see nothing.

You can add export TZ=UTC in /etc/init.d/railo_ctl. You might want to
check that script to see if there’s already a TZ setting in there.

You could also look in the java System Properties to see if user.timezone
is getting set somewhere. (i.e. <cfdump
var=“#createobject(“java”,“java.lang.System”).getProperties()#” />) If it
is, it’s probably in tomcat somewhere. ( bin/setenv.sh, maybe
conf/catalina.properties or any number of the tomcat configs… assuming
you’re running tomcat)

(in fact, bin/setenv.sh in tomcat might be a better place to put the TZ
than modifying the init.d script)

JoeOn Fri, Nov 4, 2016 at 9:22 AM, W. Williams <@W_Williams> wrote:

Thx Joe! Ok, I ran the code and here is what I got:

Server Date/Time: Nov 4, 2016 8:08 AM
Lucee Date/Time: Nov 4, 2016 8:08 AM
JVM(System) Timezone: US/Central
PageContext(Lucee) Timezone: US/Central

As you thought, the JVM is using US/Central. The issue is that I am not
defining this anywhere. I’m launching lucee and Apache using the rc.local
in the /etc/rc.d/ directory with /sbin/service railo_ctl start command.

The Lucee config is set to US/Central and that is the only setting I have
changed. Running date from the terminal on the server shows:

Fri Nov 4 13:08:41 UTC 2016

How can I correct this? Is there a setting in the server.xml or web.xml I
should be seeing. I have looked and I see nothing.


Get 10% off of the regular price for this years CFCamp in Munich, Germany
(Oct. 20th & 21st) with the Lucee discount code Lucee@cfcamp. 189€
instead of 210€. Visit https://ti.to/cfcamp/cfcamp-
2016/discount/Lucee@cfcamp

You received this message because you are subscribed to the Google Groups
“Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/
msgid/lucee/c7652b59-a95c-449a-9a8a-2c895238c2af%40googlegroups.com
https://groups.google.com/d/msgid/lucee/c7652b59-a95c-449a-9a8a-2c895238c2af%40googlegroups.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.