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. 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

3 years 5 months 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

  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Thu, 11/19/2026 - 10:57
    Gurux.DLMS.Python 1.0.204
  • Thu, 11/19/2026 - 10:12
    gurux.dlms.c 9.0.2611.1901
  • Tue, 10/13/2026 - 12:00
    gurux.dlms.java 4.0.97
  • Tue, 09/22/2026 - 14:02
    Gurux.DLMS.Net 9.0.2609.2201
  • Mon, 09/21/2026 - 10:18
    Gurux.DLMS.Net 9.0.2609.2101

New forum topics

  • Landis E650 meter reading over DLMS
  • class_id = 40, version = 2, pushsetup Unparsed data frame
  • GXObisValueItem entries without MaskSize appear to be interpreted as bit flags
  • CheckedListBox incorrectly selects GXObisValueItem Value=0 for non-zero values
  • UIValueType=TextBox is rendered as CheckedListBox when Values are defined
More
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin