Am 07.01.20 um 21:58 schrieb Jerry Malcolm:
> This may be more of a Java question than Tomcat.  But I'm not sure.  I
> have the same code, talking to the same MySql Linux (AWS) database.  I
> read a date column value in a Tomcat app.  After calling
> resultSet.getDate(...) I printed the date instance and the getTime()
> value:
>
> On windows: 2019-02-01 1549000800000
>
> On linux:       2019-01-31 1548979200000
>
> Again this is the SAME line of code in java reading the SAME field in
> the SAME database.  Only thing different is Linux/Windows OS.  The
> date is supposed to be 2/1/2019 and shows that in phpMyAdmin.
>
> I've been running on Linux for a few months.  But I don't have an
> extensive background in the specifics of Linux.  I'm sure there must
> be something that is configured differently.  I'm at a loss. But this
> is not a trivial problem.  I do monthly billing. My dates need to be
> accurate.
>
> What am I doing wrong? (BTW Tomcat 8.5.x and Java 1.8.0_222 running on
> AWS Linux, not AWS Linux 2).

Maybe different timezone settings on the clients that propagate to the
database?

Have you looked at setting/reading the timezones in mysql (and after
that on the clients) like
https://stackoverflow.com/questions/930900/how-do-i-set-the-time-zone-of-mysql

On linux a simple "date" command will print out the currently used
timezone. For me it prints:

$ date
Di 7. Jan 22:06:37 CET 2020

or without a language setting:

$ LANG= date
Tue Jan  7 22:12:05 CET 2020

Felix

>
> Thanks.
>
> Jerry
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to