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

Issue identifying DateTime Format from String in C# Automation script

Solved1.71K views18th July 2024automation scipt parameter option
0
A B M Sidddique [DevOps Advocate]371 8th January 2024 3 Comments

Hello Dojo Community !

I'm currently working on a C# script where I need to parse a string into a DateTime object. I've tried using DateTime.TryParseExact with multiple date formats, but I'm facing issues identifying the correct format.

Code snippet :

LastRestart format on the cube (table) UI:

LastRestart value from the streamviwer :

Despite trying various formats, I'm still encountering issues with certain date strings. I am not sure if the format is the one observed in the table (UI) or the one from seen from the stream viewer (loggs). I'm looking for suggestions or guidance on how to dynamically identify the correct DateTime format from a given string.

Any help, insights, or alternative approaches to accomplish this task would be greatly appreciated!

Thank you in advance for your assistance.

A B M Sidddique [DevOps Advocate] Posted new comment 18th July 2024
Marieke Goethals [SLC] [DevOps Catalyst] commented 31st May 2024

Hi,
I see that this question has been inactive for some time. Have you been able to find a solution for this yet? If yes, could you select the most helpful answer below, or add an answer of your own with the solution for the reference of other users who may have a similar problem?

Marieke Goethals [SLC] [DevOps Catalyst] commented 18th July 2024

As this question has now been open for a long time and there has been no further reaction from you, I will now close it. If you do wish to investigate this further, could you post a new question?

A B M Sidddique [DevOps Advocate] commented 18th July 2024

Yes , this can be closed now. Thank you

2 Answers

  • Active
  • Voted
  • Newest
  • Oldest
0
A B M Sidddique [DevOps Advocate]371 Posted 8th January 2024 1 Comment

Hi Floris ,
Thank you for your suggestion , I am modifying the script to look into it and testing it out to observe results.
The current protocol snippet that shows the Date time :

with my script I would want collect datetime information using Getparameter method, then perform some calculation. But the formats options I had seemed to provide was not able to identify that parameter.

NB: reply to the previous answer does not allow me to post the screenshot, so i have added as a new answer .

Jorge Dias [SLC] [DevOps Enabler] Posted new comment 8th January 2024
Jorge Dias [SLC] [DevOps Enabler] commented 8th January 2024

Hi,
If you want to convert the value from that parameter to DateTime you should use DateTime.FromOADate instead of DataTime.TryParseExact.
DateTime.TryParseExact is when you have a string representation of a date, but in this case you have an OLE Automation date.

You are viewing 1 out of 2 answers, click here to view all answers.
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

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