When using the functions GXDateTime and GXDLMSClient.changeType
at some time, I began to have a discrepancy of 1 hour. When forward, when backward.
2022-03-27 03:00:00 in my zone (UTC+2) there was a change of time 1 hour ahead (to UTC+3).
Now in system:
Therefore TZ='Europe/Kiev' will be used.
Selected time is now: Thu May 5 18:14:26 EEST 2022.
Universal Time is now: Thu May 5 15:14:26 UTC 2022.
I get time.struct_time with tm_isdst=0. I want to get tm_isdst=1. Maybe using timezone information solved the problem.
I trying
GXDT = GXDLMSClient.changeType(Daydata[0][4], DataType.DATETIME, useUtc=True)
but nothing changed.
At the same time:
UnixTime: 1650232800
GMT: Sun, 17 Apr 2022 22:00:00 GMT
Your time zone (UTC+3): 18.04.2022, 01:00:00
Looks like an error is happening in time.mktime(DT)
I can not understand what is the matter and where did I go wrong?
because there are mistakes (in fromUnixTime):
"integer argument expected, got float"
if I convert to int:
"signed integer is greater than maximum"
if I Unix timestamp devide by 1000 :
"function missing required argument 'month' (pos 2)"
i use fromHighResolutionTime for 10 digits unixtime
It might be that your meter is not using DST. It might also be that your meter is not using a different deviation than you. There are several reasons why this might occur. http://www.gurux.fi/Gurux.DLMS.Objects.GXDLMSClock
Can you add a hex trace here from Daydata[0][4] so I can check the values and tell why this is happening.
I shink that in
I shink that in GXDateTime.py
@classmethod
def fromUnixTime(cls, unixTime):
return GXDateTime(datetime.datetime(unixTime * 1000))
@classmethod
def fromHighResolutionTime(cls, unixTime):
return GXDateTime(datetime.datetime(unixTime))
looks like
@classmethod
def fromUnixTime(cls, unixTime):
return GXDateTime(datetime.datetime.fromtimestamp(unixTime * 1000))
and
@classmethod
def fromHighResolutionTime(cls, unixTime):
return GXDateTime(datetime.datetime.fromtimestamp(unixTime))
because there are mistakes (in fromUnixTime):
"integer argument expected, got float"
if I convert to int:
"signed integer is greater than maximum"
if I Unix timestamp devide by 1000 :
"function missing required argument 'month' (pos 2)"
i use fromHighResolutionTime for 10 digits unixtime
my second problem I decide:
my second problem I decide:
GXDT = GXDLMSClient.changeType(Daydata[0][4], DataType.DATETIME)
DT = GXDT.toUnixTime(GXDT)
DayCurrent = datetime.datetime(*DT[:6])
04/19/22 00:00:00 || time.struct_time(tm_year=2022, tm_mon=4, tm_mday=19, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=1, tm_yday=109, tm_isdst=0) || 2022-04-19 00:00:00
But why use GXDateTime in
But why use GXDateTime in Reader.readRowsByRange ?
when you can use standart datetime !!! That's right?
Hi,
Hi,
It might be that your meter is not using DST. It might also be that your meter is not using a different deviation than you. There are several reasons why this might occur.
http://www.gurux.fi/Gurux.DLMS.Objects.GXDLMSClock
Can you add a hex trace here from Daydata[0][4] so I can check the values and tell why this is happening.
BR,
Mikko