Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Feb 2024 22:04:32 +0100
From:      <csab6597@gmail.com>
To:        "'Michael Zhilin'" <mizhka@gmail.com>
Cc:        <freebsd-java@freebsd.org>
Subject:   AW: Issue: Java does not honor timezone setting
Message-ID:  <003a01da5f89$68dd1ad0$3a975070$@gmail.com>
In-Reply-To: <CAF19XBKqgFnGVHUq%2BZBOBqXwwrb0TTDKq5R_h_ayGtsXU=_Cfw@mail.gmail.com>
References:  <004901da5c6b$a36b1150$ea4133f0$@gmail.com> <CAF19XBKqgFnGVHUq%2BZBOBqXwwrb0TTDKq5R_h_ayGtsXU=_Cfw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multipart message in MIME format.

------=_NextPart_000_003B_01DA5F91.CAA24620
Content-Type: text/plain;
	charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi Michael,

=20

I used tzsetup and selected Europe/Austria. After doing so I now get the =
correct time zone and therefore time value in java.

=20

# date

Wed Feb 14 21:21:06 CET 2024

=20

# jshell

|  Welcome to JShell =E2=80=93 Version 19.0.2

|  For an introduction type: /help intro

=20

jshell> java.time.ZonedDateTime.now()

&1 =3D=3D> 2024-02-14T21_21_36.093531195+01:00[Europe/Vienna]

=20

Now the situation is like

*	When I change the TrueNAS systemwide timezone, which was always set to =
Europe/Vienna by the way, that is indeed reflected through the =
=E2=80=9Cdate=E2=80=9D command (but only after a system restart). But =
such a change is not adopted in Java.
*	Whereas the other way round, any change through tzsetup is indeed =
reflected in Java as well as in =E2=80=9Cdate=E2=80=9D

=20

At first I put up the following thread in the TrueNAS forum  =
<https://www.truenas.com/community/threads/java-reporting-wrong-time-zone=
-in-jail.116366/> =
https://www.truenas.com/community/threads/java-reporting-wrong-time-zone-=
in-jail.116366/ from where I was pointed to you. Do you think I should =
now point back to some TrueNAS configuration issue?

=20

Greets, Rainer

=20

=20

=20

Von: Michael Zhilin <mizhka@gmail.com>=20
Gesendet: Mittwoch, 14. Februar 2024 16:46
An: csab6597@gmail.com
Cc: freebsd-java@freebsd.org
Betreff: Re: Issue: Java does not honor timezone setting

=20

Hi,

=20

I've tried to use /usr/share/zoneinfo/CET as /etc/localtime and it seems =
java can't identify TZ correctly.

But in case of particular country's TZ, it works fine:

=20

 # tzsetup
root@tamagawa /usr/share/zoneinfo
 # date
Wed Feb 14 16:40:48 CET 2024
root@tamagawa /usr/share/zoneinfo
 # export JAVA_VERSION=3D17
root@tamagawa /usr/share/zoneinfo
 # jshell
|  Welcome to JShell -- Version 17.0.9
|  For an introduction type: /help intro

jshell> java.time.ZonedDateTime.now()
$1 =3D=3D> 2024-02-14T16:41:13.106408203+01:00[Europe/Andorra]

=20

I have no access to TrueNAS & jdk19, could you please try to specify the =
country's TZ by tzsetup and check tz in java?

=20

Thanks!

=20

=20

On Sun, Feb 11, 2024 at 12:53=E2=80=AFAM <csab6597@gmail.com =
<mailto:csab6597@gmail.com> > wrote:

Hi there,

=20

I am using TrueNAS Core TrueNAS-13.0-U6.1 where in a jail I installed =
jdk 19. In the shell I get

=20

# java -version

openjdk version "19.0.2" 2023-01-17

OpenJDK Runtime Environment (build 19.0.2+7-1)

OpenJDK 64-Bit Server VM (build 19.0.2+7-1, mixed mode, sharing)

=20

The issue I encountered is that java does not honor the timezone I have =
set in TrueNAS.

When using the builtin command  in the TrueNAS shell I can see

=20

# date
Sat Feb 10 10:36:35 CET 2024

=20

So that command reports CET timezone which is in fact what it should be, =
what is set in TrueNAS system configuration

But inside java, for a test just using jshell, then java will report GMT =
which means java is ignoring the timezone setting and thus giving an =
offset to the actual time

=20

# jshell
|  Welcome to JShell -- Version 19.0.2
|  For an introduction type: /help intro
=20
jshell> java.time.ZonedDateTime.now()
$3 =3D=3D> 2024-02-10T09:38:12.192401862Z[GMT]
=20
jshell> java.time.LocalDateTime.now()
$1 =3D=3D> 2024-02-10T09:38:12.192401862Z

=20

=20

Also tested in Windows and Ubuntu where Java will indeed report the =
correct timezone

=20

Greets, Rainer=20


------=_NextPart_000_003B_01DA5F91.CAA24620
Content-Type: text/html;
	charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" =
xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" =
xmlns=3D"http://www.w3.org/TR/REC-html40"><head><meta =
http-equiv=3DContent-Type content=3D"text/html; charset=3Dutf-8"><meta =
name=3DGenerator content=3D"Microsoft Word 15 (filtered =
medium)"><style><!--
/* Font Definitions */
@font-face
	{font-family:Wingdings;
	panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
	{font-family:PMingLiU;
	panose-1:2 1 6 1 0 1 1 1 1 1;}
@font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
	{font-family:Aptos;}
@font-face
	{font-family:Consolas;
	panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
	{font-family:"\@PMingLiU";
	panose-1:2 1 6 1 0 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	font-size:12.0pt;
	font-family:"Aptos",sans-serif;}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
pre
	{mso-style-priority:99;
	mso-style-link:"HTML Vorformatiert Zchn";
	margin:0cm;
	margin-bottom:.0001pt;
	font-size:10.0pt;
	font-family:"Courier New";}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
	{mso-style-priority:34;
	margin-top:0cm;
	margin-right:0cm;
	margin-bottom:0cm;
	margin-left:36.0pt;
	font-size:12.0pt;
	font-family:"Aptos",sans-serif;}
span.HTMLVorformatiertZchn
	{mso-style-name:"HTML Vorformatiert Zchn";
	mso-style-priority:99;
	mso-style-link:"HTML Vorformatiert";
	font-family:Consolas;
	mso-ligatures:none;}
span.E-MailFormatvorlage20
	{mso-style-type:personal-reply;
	font-family:"Aptos",sans-serif;
	color:windowtext;}
.MsoChpDefault
	{mso-style-type:export-only;}
@page WordSection1
	{size:612.0pt 792.0pt;
	margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
	{page:WordSection1;}
/* List Definitions */
@list l0
	{mso-list-id:737872014;
	mso-list-type:hybrid;
	mso-list-template-ids:1388315574 962094558 201785347 201785349 =
201785345 201785347 201785349 201785345 201785347 201785349;}
@list l0:level1
	{mso-level-start-at:0;
	mso-level-number-format:bullet;
	mso-level-text:-;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	margin-left:20.25pt;
	text-indent:-18.0pt;
	font-family:"Aptos",sans-serif;
	mso-fareast-font-family:PMingLiU;
	mso-bidi-font-family:"Times New Roman";}
@list l0:level2
	{mso-level-number-format:bullet;
	mso-level-text:o;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	margin-left:56.25pt;
	text-indent:-18.0pt;
	font-family:"Courier New";}
@list l0:level3
	{mso-level-number-format:bullet;
	mso-level-text:=EF=82=A7;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	margin-left:92.25pt;
	text-indent:-18.0pt;
	font-family:Wingdings;}
@list l0:level4
	{mso-level-number-format:bullet;
	mso-level-text:=EF=82=B7;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	margin-left:128.25pt;
	text-indent:-18.0pt;
	font-family:Symbol;}
@list l0:level5
	{mso-level-number-format:bullet;
	mso-level-text:o;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	margin-left:164.25pt;
	text-indent:-18.0pt;
	font-family:"Courier New";}
@list l0:level6
	{mso-level-number-format:bullet;
	mso-level-text:=EF=82=A7;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	margin-left:200.25pt;
	text-indent:-18.0pt;
	font-family:Wingdings;}
@list l0:level7
	{mso-level-number-format:bullet;
	mso-level-text:=EF=82=B7;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	margin-left:236.25pt;
	text-indent:-18.0pt;
	font-family:Symbol;}
@list l0:level8
	{mso-level-number-format:bullet;
	mso-level-text:o;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	margin-left:272.25pt;
	text-indent:-18.0pt;
	font-family:"Courier New";}
@list l0:level9
	{mso-level-number-format:bullet;
	mso-level-text:=EF=82=A7;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	margin-left:308.25pt;
	text-indent:-18.0pt;
	font-family:Wingdings;}
ol
	{margin-bottom:0cm;}
ul
	{margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]--></head><body lang=3DDE-AT link=3Dblue =
vlink=3Dpurple style=3D'word-wrap:break-word'><div =
class=3DWordSection1><p class=3DMsoNormal><span =
style=3D'font-size:11.0pt'>Hi Michael,<o:p></o:p></span></p><p =
class=3DMsoNormal><span =
style=3D'font-size:11.0pt'><o:p>&nbsp;</o:p></span></p><p =
class=3DMsoNormal><span lang=3DEN-US style=3D'font-size:11.0pt'>I used =
tzsetup and selected Europe/Austria. After doing so I now get the =
correct time zone and therefore time value in =
java.<o:p></o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US =
style=3D'font-size:11.0pt'><o:p>&nbsp;</o:p></span></p><p =
class=3DMsoNormal style=3D'background:#F2F2F2'><span lang=3DEN-US =
style=3D'font-size:11.0pt;color:black'># date</span><span lang=3DEN-US =
style=3D'font-size:11.0pt'><o:p></o:p></span></p><p class=3DMsoNormal =
style=3D'background:#F2F2F2'><span lang=3DEN-US =
style=3D'font-size:11.0pt;color:black'>Wed Feb 14 21:21:06 CET =
2024</span><span lang=3DEN-US =
style=3D'font-size:11.0pt'><o:p></o:p></span></p><p class=3DMsoNormal =
style=3D'background:#F2F2F2'><span lang=3DEN-US =
style=3D'font-size:11.0pt'><o:p>&nbsp;</o:p></span></p><p =
class=3DMsoNormal style=3D'background:#F2F2F2'><span lang=3DEN-US =
style=3D'font-size:11.0pt;color:black'># jshell</span><span lang=3DEN-US =
style=3D'font-size:11.0pt'><o:p></o:p></span></p><p class=3DMsoNormal =
style=3D'background:#F2F2F2'><span lang=3DEN-US =
style=3D'font-size:11.0pt;color:black'>| =C2=A0Welcome to JShell =
=E2=80=93 Version 19.0.2</span><span lang=3DEN-US =
style=3D'font-size:11.0pt'><o:p></o:p></span></p><p class=3DMsoNormal =
style=3D'background:#F2F2F2'><span lang=3DEN-US =
style=3D'font-size:11.0pt;color:black'>|=C2=A0 For an introduction type: =
/help intro</span><span lang=3DEN-US =
style=3D'font-size:11.0pt'><o:p></o:p></span></p><p class=3DMsoNormal =
style=3D'background:#F2F2F2'><span lang=3DEN-US =
style=3D'font-size:11.0pt'><o:p>&nbsp;</o:p></span></p><p =
class=3DMsoNormal style=3D'background:#F2F2F2'><span lang=3DEN-US =
style=3D'font-size:11.0pt;color:black'>jshell&gt; =
java.time.ZonedDateTime.now()</span><span lang=3DEN-US =
style=3D'font-size:11.0pt'><o:p></o:p></span></p><p class=3DMsoNormal =
style=3D'background:#F2F2F2'><span lang=3DEN-US =
style=3D'font-size:11.0pt;color:black'>&amp;1 =3D=3D&gt; =
2024-02-14T21_21_36.093531195+01:00[Europe/Vienna]</span><span =
lang=3DEN-US style=3D'font-size:11.0pt'><o:p></o:p></span></p><p =
class=3DMsoNormal><span lang=3DEN-US =
style=3D'font-size:11.0pt'><o:p>&nbsp;</o:p></span></p><p =
class=3DMsoNormal><span lang=3DEN-US style=3D'font-size:11.0pt'>Now the =
situation is like<o:p></o:p></span></p><ul style=3D'margin-top:0cm' =
type=3Ddisc><li class=3DMsoListParagraph =
style=3D'margin-left:-15.75pt;mso-list:l0 level1 lfo1'><span =
lang=3DEN-US style=3D'font-size:11.0pt'>When I change the TrueNAS =
systemwide timezone, which was always set to Europe/Vienna by the way, =
that is indeed reflected through the =E2=80=9Cdate=E2=80=9D command (but =
only after a system restart). But such a change is not adopted in =
Java.<o:p></o:p></span></li><li class=3DMsoListParagraph =
style=3D'margin-left:-15.75pt;mso-list:l0 level1 lfo1'><span =
lang=3DEN-US style=3D'font-size:11.0pt'>Whereas the other way round, any =
change through tzsetup is indeed reflected in Java as well as in =
=E2=80=9Cdate=E2=80=9D<o:p></o:p></span></li></ul><p =
class=3DMsoNormal><span lang=3DEN-US =
style=3D'font-size:11.0pt'><o:p>&nbsp;</o:p></span></p><p =
class=3DMsoNormal><span lang=3DEN-US style=3D'font-size:11.0pt'>At first =
I put up the following thread in the TrueNAS forum </span><span =
style=3D'font-size:11.0pt'><a =
href=3D"https://www.truenas.com/community/threads/java-reporting-wrong-ti=
me-zone-in-jail.116366/"><span =
lang=3DEN-US>https://www.truenas.com/community/threads/java-reporting-wro=
ng-time-zone-in-jail.116366/</span></a></span><span =
style=3D'font-size:11.0pt'> <span lang=3DEN-US>from where I was pointed =
to you. Do you think I should now point back to some TrueNAS =
configuration issue?<o:p></o:p></span></span></p><p =
class=3DMsoNormal><span lang=3DEN-US =
style=3D'font-size:11.0pt'><o:p>&nbsp;</o:p></span></p><p =
class=3DMsoNormal><span lang=3DEN-US style=3D'font-size:11.0pt'>Greets, =
Rainer<o:p></o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US =
style=3D'font-size:11.0pt'><o:p>&nbsp;</o:p></span></p><p =
class=3DMsoNormal><span lang=3DEN-US =
style=3D'font-size:11.0pt'><o:p>&nbsp;</o:p></span></p><p =
class=3DMsoNormal><span lang=3DEN-US =
style=3D'font-size:11.0pt'><o:p>&nbsp;</o:p></span></p><div =
style=3D'border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm =
0cm 0cm'><p class=3DMsoNormal><b><span lang=3DDE =
style=3D'font-size:11.0pt;font-family:"Calibri",sans-serif'>Von:</span></=
b><span lang=3DDE =
style=3D'font-size:11.0pt;font-family:"Calibri",sans-serif'> Michael =
Zhilin &lt;mizhka@gmail.com&gt; <br><b>Gesendet:</b> Mittwoch, 14. =
Februar 2024 16:46<br><b>An:</b> csab6597@gmail.com<br><b>Cc:</b> =
freebsd-java@freebsd.org<br><b>Betreff:</b> Re: Issue: Java does not =
honor timezone setting<o:p></o:p></span></p></div><p =
class=3DMsoNormal><o:p>&nbsp;</o:p></p><div><div><p =
class=3DMsoNormal>Hi,<o:p></o:p></p></div><div><p =
class=3DMsoNormal><o:p>&nbsp;</o:p></p></div><div><p =
class=3DMsoNormal>I've tried to use /usr/share/zoneinfo/CET as =
/etc/localtime and it seems java can't identify TZ =
correctly.<o:p></o:p></p></div><div><p class=3DMsoNormal>But in case of =
particular country's TZ, it works fine:<o:p></o:p></p></div><div><p =
class=3DMsoNormal><o:p>&nbsp;</o:p></p></div><div><p =
class=3DMsoNormal>&nbsp;# tzsetup<br>root@tamagawa =
/usr/share/zoneinfo<br>&nbsp;# date<br>Wed Feb 14 16:40:48 CET =
2024<br>root@tamagawa /usr/share/zoneinfo<br>&nbsp;# export =
JAVA_VERSION=3D17<br>root@tamagawa /usr/share/zoneinfo<br>&nbsp;# =
jshell<br>| &nbsp;Welcome to JShell -- Version 17.0.9<br>| &nbsp;For an =
introduction type: /help intro<br><br>jshell&gt; =
java.time.ZonedDateTime.now()<br>$1 =3D=3D&gt; =
2024-02-14T16:41:13.106408203+01:00[Europe/Andorra]<o:p></o:p></p></div><=
div><p class=3DMsoNormal><o:p>&nbsp;</o:p></p></div><div><p =
class=3DMsoNormal>I have no access to TrueNAS &amp; jdk19, could you =
please try to specify the country's TZ by tzsetup and check tz in =
java?<o:p></o:p></p></div><div><p =
class=3DMsoNormal><o:p>&nbsp;</o:p></p></div><div><p =
class=3DMsoNormal>Thanks!<o:p></o:p></p></div><div><p =
class=3DMsoNormal><o:p>&nbsp;</o:p></p></div></div><p =
class=3DMsoNormal><o:p>&nbsp;</o:p></p><div><div><p class=3DMsoNormal>On =
Sun, Feb 11, 2024 at 12:53<span =
style=3D'font-family:"Arial",sans-serif'>=E2=80=AF</span>AM &lt;<a =
href=3D"mailto:csab6597@gmail.com">csab6597@gmail.com</a>&gt; =
wrote:<o:p></o:p></p></div><blockquote =
style=3D'border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm =
6.0pt;margin-left:4.8pt;margin-right:0cm'><div><div><div><p =
class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span =
lang=3DEN-US style=3D'font-size:11.0pt'>Hi =
there,</span><o:p></o:p></p><p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span =
lang=3DEN-US style=3D'font-size:11.0pt'>&nbsp;</span><o:p></o:p></p><p =
class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span =
lang=3DEN-US style=3D'font-size:11.0pt'>I am using TrueNAS Core =
TrueNAS-13.0-U6.1 where in a jail I installed jdk 19. In the shell I =
get</span><o:p></o:p></p><p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span =
lang=3DEN-US style=3D'font-size:11.0pt'>&nbsp;</span><o:p></o:p></p><p =
class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:#E=
8E8E8'><span lang=3DEN-US style=3D'font-size:10.0pt;font-family:"Courier =
New";color:black'># java -version</span><o:p></o:p></p><p =
class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:#E=
8E8E8'><span lang=3DEN-US style=3D'font-size:10.0pt;font-family:"Courier =
New";color:black'>openjdk version &quot;19.0.2&quot; =
2023-01-17</span><o:p></o:p></p><p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:#E=
8E8E8'><span lang=3DEN-US style=3D'font-size:10.0pt;font-family:"Courier =
New";color:black'>OpenJDK Runtime Environment (build =
19.0.2+7-1)</span><o:p></o:p></p><p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:#E=
8E8E8'><span lang=3DEN-US style=3D'font-size:10.0pt;font-family:"Courier =
New";color:black'>OpenJDK 64-Bit Server VM (build 19.0.2+7-1, mixed =
mode, sharing)</span><o:p></o:p></p><p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span =
lang=3DEN-US style=3D'font-size:11.0pt'>&nbsp;</span><o:p></o:p></p><p =
class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span =
lang=3DEN-US style=3D'font-size:11.0pt'>The issue I encountered is that =
java does not honor the timezone I have set in =
TrueNAS.</span><o:p></o:p></p><p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span =
lang=3DEN-US style=3D'font-size:11.0pt'>When using the builtin command =
&nbsp;in the TrueNAS shell I can see</span><o:p></o:p></p><p =
class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span =
lang=3DEN-US style=3D'font-size:11.0pt'>&nbsp;</span><o:p></o:p></p><pre =
style=3D'background:#E8E8E8'><span lang=3DEN-US style=3D'color:black'># =
date</span><o:p></o:p></pre><pre style=3D'background:#E8E8E8'><span =
lang=3DEN-US style=3D'color:black'>Sat Feb 10 10:36:35 CET =
2024</span><o:p></o:p></pre><p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span =
lang=3DEN-US style=3D'font-size:11.0pt'>&nbsp;</span><o:p></o:p></p><p =
class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span =
lang=3DEN-US style=3D'font-size:11.0pt'>So that command reports CET =
timezone which is in fact what it should be, what is set in TrueNAS =
system configuration</span><o:p></o:p></p><p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span =
lang=3DEN-US style=3D'font-size:11.0pt'>But inside java, for a test just =
using jshell, then java will report GMT which means java is ignoring the =
timezone setting and thus giving an offset to the actual =
time</span><o:p></o:p></p><p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span =
lang=3DEN-US style=3D'font-size:11.0pt'>&nbsp;</span><o:p></o:p></p><pre =
style=3D'background:#E8E8E8'><span lang=3DEN-US style=3D'color:black'># =
jshell</span><o:p></o:p></pre><pre style=3D'background:#E8E8E8'><span =
lang=3DEN-US style=3D'color:black'>|&nbsp; Welcome to JShell -- Version =
19.0.2</span><o:p></o:p></pre><pre style=3D'background:#E8E8E8'><span =
lang=3DEN-US style=3D'color:black'>|&nbsp; For an introduction type: =
/help intro</span><o:p></o:p></pre><pre =
style=3D'background:#E8E8E8'><span lang=3DEN-US =
style=3D'color:black'>&nbsp;</span><o:p></o:p></pre><pre =
style=3D'background:#E8E8E8'><span lang=3DEN-US =
style=3D'color:black'>jshell&gt; =
java.time.ZonedDateTime.now()</span><o:p></o:p></pre><pre =
style=3D'background:#E8E8E8'><span lang=3DEN-US style=3D'color:black'>$3 =
=3D=3D&gt; =
2024-02-10T09:38:12.192401862Z[GMT]</span><o:p></o:p></pre><pre =
style=3D'background:#E8E8E8'><span lang=3DEN-US =
style=3D'color:black'>&nbsp;</span><o:p></o:p></pre><pre =
style=3D'background:#E8E8E8'><span lang=3DEN-US =
style=3D'color:black'>jshell&gt; =
java.time.LocalDateTime.now()</span><o:p></o:p></pre><pre =
style=3D'background:#E8E8E8'><span lang=3DEN-US style=3D'color:black'>$1 =
=3D=3D&gt; 2024-02-10T09:38:12.192401862Z</span><o:p></o:p></pre><p =
class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span =
lang=3DEN-US style=3D'font-size:11.0pt'>&nbsp;</span><o:p></o:p></p><p =
class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span =
lang=3DEN-US style=3D'font-size:11.0pt'>&nbsp;</span><o:p></o:p></p><p =
class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span =
lang=3DEN-US style=3D'font-size:11.0pt'>Also tested in Windows and =
Ubuntu where Java will indeed report the correct =
timezone</span><o:p></o:p></p><p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span =
lang=3DEN-US style=3D'font-size:11.0pt'>&nbsp;</span><o:p></o:p></p><p =
class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span =
lang=3DEN-US style=3D'font-size:11.0pt'>Greets, Rainer =
</span><o:p></o:p></p></div></div></div></blockquote></div></div></body><=
/html>
------=_NextPart_000_003B_01DA5F91.CAA24620--




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?003a01da5f89$68dd1ad0$3a975070$>