Skip to content
DataMiner Dojo

More results...

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Search in posts
Search in pages
Search in posts
Search in pages
Log in
Menu
  • Updates & Insights
  • Questions
  • Learning
    • E-learning Courses
    • Tutorials
    • Open Classroom Training
    • Certification
      • DataMiner Fundamentals
      • DataMiner Configurator
      • DataMiner Automation
      • Scripts & Connectors Developer: HTTP Basics
      • Scripts & Connectors Developer: SNMP Basics
      • Visual Overview – Level 1
      • Verify a certificate
    • YouTube Videos
    • Solutions & Use Cases
      • Solutions
      • Use Case Library
    • Agility
      • Learn more about Agile
        • Agile Webspace
        • Everything Agile
          • The Agile Manifesto
          • Best Practices
          • Retro Recipes
        • Methodologies
          • The Scrum Framework
          • Kanban
          • Extreme Programming
        • Roles
          • The Product Owner
          • The Agile Coach
          • The Quality & UX Coach (QX)
      • Book your Agile Fundamentals training
      • Book your Kanban workshop
    • >> Go to DataMiner Docs
  • DevOps
    • About the DevOps Program
    • Sign up for the DevOps Program
    • DataMiner DevOps Support
    • Feature Suggestions
  • Downloads
  • Swag Shop
  • PARTNERS
    • Business Partners
    • Technology Partners
  • Contact
    • Sales, Training & Certification
    • DataMiner Support
    • Global Feedback Survey
  • >> Go to dataminer.services

date in hexadecimal

305 views24th April 2026
3
Alex Gomez Gomez54 23rd April 2026 0 Comments

The dataminer element shows me the date of the equipment in hexadecimal

Robin Spruytte [SLC] [DevOps Advocate] Answered question 24th April 2026

3 Answers

  • Active
  • Voted
  • Newest
  • Oldest
2
Miguel Obregon [SLC] [DevOps Catalyst]22.84K Posted 23rd April 2026 2 Comments

Hi Alex,

Can you try the suggestions described in these questions:

  • Driver: convert hexadecimal value to letters
  • Converting SNMP octetstrings to readable ASCII in xml code

Hope it helps.

Update:

Having a look at the OID definition:

It seems that changing the type will not make a difference. Looking at other connectors that implement the same OID, I noticed that a QAction is required to parse the raw data so the datetime can be displayed correctly in the parameter.

Miguel Obregon [SLC] [DevOps Catalyst] Edited answer 23rd April 2026
Alex Gomez Gomez commented 23rd April 2026

OctetStringASCII or the OctetStringUTF8, It gives me the same result, Any suggestions?

Miguel Obregon [SLC] [DevOps Catalyst] commented 23rd April 2026

Hi Alex,
See updated answer.

1
Maria Correa [SLC] [DevOps Advocate]187 Posted 23rd April 2026 1 Comment

Hello,
You might have to leave the type as an octetstring and parse the hex value on a QAction to return a double value and then set that double value to another parameter of interprete type double with measurement type date number.

So for example: (a quick method made in copilot)
private static double ParseDateValue(SLProtocol protocol, string value)
{
if (string.IsNullOrWhiteSpace(value))
throw new ArgumentException("Invalid input");

value = value.Replace(".", "");

// Required: YYYYMMDD (hex)
if (value.Length < 8)
throw new FormatException("Invalid date format");

int year = Convert.ToInt32(value.Substring(0, 4), 16);
int month = Convert.ToInt32(value.Substring(4, 2), 16);
int day = Convert.ToInt32(value.Substring(6, 2), 16);

int hour = 0, min = 0, sec = 0, ms = 0;

if (value.Length >= 12)
{
hour = Convert.ToInt32(value.Substring(8, 2), 16);
min = Convert.ToInt32(value.Substring(10, 2), 16);
}

if (value.Length >= 16)
{
sec = Convert.ToInt32(value.Substring(12, 2), 16);
ms = Convert.ToInt32(value.Substring(14, 2), 16);
}

// Ignore timezone (same as original)
var dt = new DateTime(year, month, day, hour, min, sec, ms);

return dt.ToOADate();
}

And you want to set the return value to a parameter like this:

<Param id="1" trending="false">
		<Name>ParsedDatetime</Name>
		<Description>Parsed DateTime</Description>
		<Information>
			<Subtext></Subtext>
		</Information>
		<Type>read</Type>
		<Interprete>
			<RawType>numeric text</RawType>
			<LengthType>next param</LengthType>
			<Type>double</Type>
			<Decimals>8</Decimals>
		</Interprete>
		<Display>
			<RTDisplay>true</RTDisplay>
		</Display>
		<Measurement>
			<Type options="date">number</Type>
		</Measurement>
</Param>
Michiel Clepkens [SLC] [DevOps Advocate] Posted new comment 27th April 2026
Michiel Clepkens [SLC] [DevOps Advocate] commented 27th April 2026

The Interprete.Decimals and Display.Decimals tags of the parameter need to be set to 8 to avoid rounding errors. More info is available on https://docs.dataminer.services/develop/schemadoc/Protocol/Protocol.Params.Param.Measurement.Type-options.html#date

0
Robin Spruytte [SLC] [DevOps Advocate]798 Posted 24th April 2026 0 Comments

Hi Alex,

When dealing with such cases, I use the following method to convert the string to a DateTime. You can then use this method in a QAction to fill a new column with the DateTime values:
/// <summary>
/// Converts SNMP DateTime to System.DateTime.
/// </summary>
/// <param name="hexTimeString">SNMP DateTime with DateAndTime hex format.</param>
/// <param name="separator">Expected character that splits the hex parts.</param>
/// <returns>System.DateTime. If String is Empty or null returns Minimum DateTime Value.</returns>
public static DateTime HexToDateTime(string hexTimeString, char separator)
{
if (hexTimeString == null || hexTimeString == String.Empty)
{
return DateTime.MinValue;
}

string[] splitHex = hexTimeString.Trim(separator).Split(separator);

int[] splitHexNumbers = splitHex.Select((v) => Convert.ToInt32(Convert.ToUInt32(v, 16))).ToArray();

int year = (splitHexNumbers[0] << 8) + splitHexNumbers[1];

if (year == 0)
{
year = 1;
}

DateTime temp = new DateTime(
year,
splitHexNumbers[2],
splitHexNumbers[3],
splitHexNumbers[4],
splitHexNumbers[5],
splitHexNumbers[6],
splitHexNumbers[7] < 10 ? splitHexNumbers[7] * 100 : 0, // deci-seconds To Milliseconds
DateTimeKind.Utc);
if (splitHex.Length <= 8)
{
return temp;
}
if (Convert.ToChar(splitHexNumbers[8]) == '+')
{
return temp + new TimeSpan(splitHexNumbers[9], splitHexNumbers[10], 0);
}
else
{
return temp - new TimeSpan(splitHexNumbers[9], splitHexNumbers[10], 0);
}
}

Robin Spruytte [SLC] [DevOps Advocate] Edited answer 24th April 2026
Please login to be able to comment or post an answer.

My DevOps rank

DevOps Members get more insights on their profile page.

My user earnings

0 Dojo credits

Spend your credits in our swag shop.

0 Reputation points

Boost your reputation, climb the leaderboard.

Promo banner DataMiner DevOps Professiona Program
DataMiner Integration Studio (DIS)
Empower Katas
Privacy Policy • Terms & Conditions • Contact

© 2026 Skyline Communications. All rights reserved.

DOJO Q&A widget

Can't find what you need?

? Explore the Q&A DataMiner Docs

[ Placeholder content for popup link ] WordPress Download Manager - Best Download Management Plugin