Skip to main content
Home
for DLMS smart meters

Main navigation

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

Breadcrumb

  1. Home
  2. Forums
  3. Error Convert Datetime

Error convert datetime

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 mbathe, 23 February, 2022
Forums
Known problems

When I read a date I get a hexadecimal string for example "07E40205030B391200000002" I would like to know how to convert this string into a date in C# and python
the solutions proposed for this same problem do not work for me

Profile picture for user Kurumi

Kurumi

4 years ago

Hi,

Hi,

You can use GXDLMSClient.ChangeType to convert byte array to date-time.
Something like:

GXDateTime dt = (GXDateTime) GXDLMSClient.ChangeType(YOUR_BYTE_ARRAY_VALUE, DataType.DateTime);

There is an error on the clock status (The last byte in your hex string). The value is 2 and it's not used (reserved) in DMLS standard. Convert works, but that status state is lost.

BR,
Mikko

  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Thu, 02/19/2026 - 11:51
    gurux.dlms.cpp 9.0.2602.1901
  • Sun, 02/01/2026 - 19:47
    gurux.dlms.cpp 9.0.2602.0101
  • Tue, 01/20/2026 - 10:38
    gurux.dlms.java 4.0.89
  • Wed, 01/14/2026 - 14:29
    Gurux.DLMS.Python 1.0.196
  • Mon, 12/29/2025 - 10:38
    Gurux.Serial.Android 3.0.5

New forum topics

  • Help with connection and read with landis+gyr e650 + CU-E22 using python
  • Preestablished connection
  • RJ11 to RS232 Pin out SECURE Premier 300
  • GENUS sugam 3 PH bidirectional
  • Electricity smart Meter DLMS firmware stack
More

Who's new

  • sosapa
  • tassnim
  • bvkrishna
  • yitian
  • varunyou
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin