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 2 months 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

  • Mon, 05/11/2026 - 11:07
    Gurux.DLMS.Go 1.0.17
  • Mon, 04/27/2026 - 08:37
    Gurux.DLMS.Go 1.0.16
  • Thu, 04/23/2026 - 13:19
    Gurux.DLMS.Net 9.0.2604.2101
  • Tue, 04/14/2026 - 11:47
    gurux.dlms.java 4.0.93
  • Mon, 04/13/2026 - 16:12
    gurux.dlms.java 4.0.92

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