Skip to main content
Home
for DLMS smart meters

Main navigation

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

Breadcrumb

  1. Home
  2. Node
  3. Python - Datetime to Hex

Python - Datetime to Hex

By nhzq, 25 May, 2023
Forums
Gurux.DLMS

Is it possible to convert datetime to hex string? I am using python. For example:

client = GXDLMSClient()
hex_str = "07E705180300000000800000"
dt = client.changeType(hex_str, DataType.DATETIME)
print(dt)

result: 05/24/23 00:00:00:000000

Now I want to convert from 05/24/23 00:00:00:000000 to 07E705180300000000800000.

Is it possible?

Profile picture for user Kurumi

Kurumi

6 days 14 hours ago

Hi, Upgrade to the latest…

Hi,

Upgrade to the latest version. You can convert it to the text with toHex method.

client = GXDLMSClient()
hex_str = "07E705180300000000800000"
dt = client.changeType(hex_str, DataType.DATETIME)
print(dt.toHex(True, False))

BR,
Mikko

  • Log in or register to post comments
  • Create new account
  • Reset your password

Hire Us!

Latest Releases

Fri, 06/02/2023 - 14:13
GXDLMSDirector 9.0.2306.0201
Fri, 06/02/2023 - 13:51
Gurux.DLMS.Net 9.0.2306.0201
Fri, 06/02/2023 - 10:33
Gurux.DLMS.AMI4 4.0.2306.0201
Thu, 06/01/2023 - 16:39
Gurux.DLMS.AMI4 4.0.2306.0101
Thu, 06/01/2023 - 15:25
gurux.dlms.cpp 20230601.1

Open bugs

gurux.dlms.c
4
gurux.dlms.cpp
3
gurux.dlms.delphi
1

New forum topics

  • Optical port
  • Unable to connect - Unhandled exception.
  • Reading objects in US Association
  • Error when trying to read meter with GXDLMSDirector.
  • Meter without user
More
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin