Skip to main content
Home
for DLMS smart meters
Open source solutions for DLMS smart metering

Main navigation

  • Home
  • Products
  • About us
  • Open Source
  • Community
  • Forum
  • Downloads
User account menu
  • Log in

Breadcrumb

  1. Home
  2. Forums
  3. Regression On GXDateTime Deviation Field

Regression on GXDateTime deviation field

Forum Rules

Before commenting read Forum rules

Don't comment the topic if you have a new question.

You can create a new topic selecting correct category from Gurux Forum and then create a new topic selecting "New Topic" from the top left.

By Nico , 8 June, 2017
Forums
Gurux DLMS for Java

Hello,

Recently upgrading from Gurux 1.4.5 to 2.1.1, I noticed an issue concerning the setting/getting of the deviation field when creating a GXDateTime object.

This simple unit test below:
@Test
public void testGXDateTime() {
int deviationOne = 60;
GXDateTime dt = new GXDateTime(2017,02,04,12,00,0,0,deviationOne);
int deviationTwo = dt.getDeviation();
assertEquals(deviationOne, deviationTwo);
}

Gives:
java.lang.AssertionError:
Expected :60
Actual :-60

Could you please confirm that this is an issue?
And would you have any idea on how to fix this ?

Thanks

nico

Profile picture for user Kurumi

Kurumi

9 years ago

Regression on GXDateTime deviation field

Hi,

First. Use version 2.1.4. It's the latest.

Standard says that deviation is in minutes of local time to UTC (Page 46 in Blue book). So, if your timezone is 60, deviation is -60. In my mind this is not a good idea and I know that there are lots of meters where deviation = Time Zone. (60=60). But we can't effect to it.

getDeviation returns current time zone to UTC time.
devitation in constructor is actual time zone. There is a historical reason and we can't change this.

I'll have add work list that we'll rename constructor deviation to timeZone.

BR,

Mikko

Nico

9 years ago

In reply to Regression on GXDateTime deviation field by Kurumi

Hi Mikko,

Hi Mikko,

Thanks for your very prompt message.
I am now using version 2.1.4 indeed.

it is true that the name is misleading but your explanation is very clear and helpful - maybe a comment in the source code would prevent confusion ?

Thanks again,

Nico

Profile picture for user Kurumi

Kurumi

8 years 12 months ago

Regression on GXDateTime deviation field

Hi,

We have renamed this and added comment also.

BR,

Mikko

Dmitry R.

4 years 8 months ago

Hi,

Hi,

Can we be sure enough to consider the deviation the minus-operand to the local time istead of timezone as itself?
Suppose The Blue Book says it ambiguously:
- ... in minutes of local time to UTC (GMT)...
I give it rather plus then minus. Also the diagram in The Blue Book concerning the DST shift handling shows the positive shift at the start of DST (summer) period and the negative one at the end, so don't you think it means that deviation for the +timezones should be positive (i.e. deviation=timezone)?
May be there are any clarifications from the DLMS Association experts, aren't there?

Profile picture for user Kurumi

Kurumi

4 years 8 months ago

In reply to Hi, by Dmitry R.

Hi Dmitry,

Hi Dmitry,

Please, create a new topic, if you have a new question. You can get more information from here:

https://www.gurux.fi/Gurux.DLMS.Objects.GXDLMSClock#deviation

BR,
Mikko

  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Tue, 06/09/2026 - 11:16
    gurux.dlms.java 4.0.95
  • Tue, 06/09/2026 - 10:03
    Gurux.DLMS.Python 1.0.199
  • Mon, 06/08/2026 - 13:39
    gurux.dlms.cpp 9.0.2606.0801
  • Mon, 06/01/2026 - 10:15
    gurux.dlms.cpp 9.0.2606.0101
  • Thu, 05/28/2026 - 16:06
    gurux.dlms.java 4.0.94

New forum topics

  • Error reading L&G Meter
  • Pass a TCP Client to GXNet
  • Australian EDMI Mk10D (Essential Energy area)
  • Strange mix of data notificiation vs get response
  • DLMS Connection
More

Who's new

  • Tuanhgg
  • Adel
  • charnon
  • Paddles
  • Miguel Ángel
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin