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
    • Empower Replay: Limited Edition
    • 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
    • Video Library
    • Books We Like
    • >> Go to DataMiner Docs
  • Expert Center
    • Solutions & Use Cases
      • Solutions
      • Use Case Library
    • Markets & Industries
      • Media production
      • Government & defense
      • Content distribution
      • Service providers
      • Partners
      • OSS/BSS
    • 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)
    • DataMiner DevOps Professional Program
      • About the DevOps Program
      • DataMiner DevOps Support
  • Downloads
  • More
    • DataMiner Releases & Updates
    • Feature Suggestions
    • Climb the leaderboard!
    • Swag Shop
    • Contact
    • Global Feedback Survey
  • PARTNERS
    • All Partners
    • Technology Partners
    • Strategic Partner Program
    • Deal Registration
  • >> Go to dataminer.services

How to display a Linux Time Stamp?

Solved3.96K views18th October 2023linux time
6
Dominique Bodart [DevOps Member]693 18th July 2023 0 Comments

Hi,

An API send me back information with Linux format time stamp as 32 bits Unsigned Integer like:

1689690756 which means “2023-07-18 14:32:36 UTC”.  In the parameter to retrieve that value, I set “Measurment” as follow:

<Measurement>
<Type options=”time”>number</Type>
</Measurement>

And the result is: “19556 days 14h 32m 36s”. So, its ok for the hours but not for the date. I couldn’t find any reference to Linux time in the “SLC_UM_DataMinerDevelopmentLibrary_REV030” manual. So, is there a way to handle linux time in parameters and translate them properly without going through a QAction which could do the job?

Marieke Goethals [SLC] [DevOps Catalyst] Selected answer as best 18th October 2023

4 Answers

  • Active
  • Voted
  • Newest
  • Oldest
13
João Severino [SLC] [DevOps Catalyst]13.09K Posted 18th July 2023 1 Comment

Hi Dominique,

As far as I know, there is no direct way of achieving this directly but it could be possible with either a QAction and using the C# DateTime object or alternatively if you do not want to use a QAction you could use a combination of Sequence and DateTime measurement option

You would in essence convert from Unix Time Stamp format to OLE Date format with a set of operations in the Sequence tag and then you would use the DateTime option to make it display as a Date Time in your parameter.

The mathematical expression you need is as follows:

OLE Automation Date = (Unix Timestamp / 86400) + 25569

Where 86400 is the number of seconds in a day and 25569 is the offset between the “origin” dates of each of the formats

Which would translate into

<Sequence noset=“true”>div:86400;offset:25569</Sequence>

Marieke Goethals [SLC] [DevOps Catalyst] Selected answer as best 18th October 2023
Dominique Bodart [DevOps Member] commented 19th July 2023

Thank you João,

This indeed a the simplest way so far to handle Linux Time Stamp. So, I apply:
div:86400;offset:25569

And:

number

Which gives the correct result:

19/07/2023 08:45:09, for instance

2
Miguel Obregon [SLC] [DevOps Catalyst]19.12K Posted 18th July 2023 1 Comment

Hi Dominique,

Linux stores time at the number of seconds since Jan 1, 1970 (epoch time). According to the documentation pointed by Koen:

The timestamp is stored internally as an OLE Automation date: a decimal number indicating the total number of days passed since Midnight 1899-12-30.

So I believe you will need to use a QAction that converts the epoch time to OLE Automation date.

Thomas Cauwelier [SLC] [DevOps Advocate] Edited comment 18th July 2023
Thomas Cauwelier [SLC] [DevOps Advocate] commented 18th July 2023

You can use the following method to convert the uint to a DateTimeOffset object.
https://learn.microsoft.com/en-us/dotnet/api/system.datetimeoffset.fromunixtimeseconds?view=netframework-4.6.2#system-datetimeoffset-fromunixtimeseconds(system-int64)
This object can then be converted to the OLE format that dataminer is expecting using dateTimeOffset.UtcDateTime.ToOADate().

The option on the parameter must be set to “datetime” instead of “time” to correctly display the date.

0
Ive Herreman [SLC] [DevOps Enabler]13.59K Posted 18th July 2023 0 Comments

Hi Dominique,

I don’t think it’s possible to use the epoch time without going through a QAction.
There is a measurement option datetime, but that option expects an OAdate double value.

Ive Herreman [SLC] [DevOps Enabler] Answered question 18th July 2023
0
Koen Annys [SLC] [DevOps Advocate]144 Posted 18th July 2023 0 Comments

Hi,

the option “time” will show a time duration, did you try the options “date”, “datetime” or “timeofday” ?

Options are described here.

Koen Annys [SLC] [DevOps Advocate] Answered question 18th July 2023
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

© 2025 Skyline Communications. All rights reserved.

DOJO Q&A widget

Can't find what you need?

? Explore the Q&A DataMiner Docs