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

GQI adhoc time zone

Solved915 views18th September 2024Ad Hoc data source low code apps
1
Carlos Matheus [SLC] [DevOps Advocate]318 17th September 2024 0 Comments

Hi Dojo,

How I can display a datetime field of a DOM object in local time in a LCA, but display the date and time as separate columns

I tried using column manipulations with regex and custom operators, which works, but the issue is that since the initial ad hoc source is subscribed to real-time updates, the new values take too long to update, which is also undesirable.

Not sure what other possible options I should try here; any recommendations would be appreciated.

Thank you!

UPDATE

this is showing the correct time using the column manipulations but losing the ability of real time updates. is showing the local time which is the idea.

Now, this is by using the displayValue and is showing the incorrect time, using the server time

Carlos Matheus [SLC] [DevOps Advocate] Edited question 18th September 2024

1 Answer

  • Active
  • Voted
  • Newest
  • Oldest
4
Ronald Gerard [SLC] [DevOps Advocate]1.74K Posted 18th September 2024 4 Comments

Hi Carlos,

Both custom operators and column manipulation operators indeed do not support real-time updates yet and will only update every 30 seconds if an update was detected.
Real-time updates for these operators will be supported in the future.

For now, the solution is to integrate the datetime transformation into the initial Ad Hoc data source.

Note: if the ad hoc data source is also to be reused in places where no such datetime transformation is necessary, we would recommend to create a separate ad hoc data source for that in the same library that can derive from the original and add this specific behavior.

Ronald Gerard [SLC] [DevOps Advocate] Posted new comment 19th September 2024
Carlos Matheus [SLC] [DevOps Advocate] commented 18th September 2024

I’m trying that on my end but haven’t accomplished it yet. Could you give me some directions on how to do it? What I’ve tried so far hasn’t worked, as it still returns the server time instead of the user’s local time.

Ronald Gerard [SLC] [DevOps Advocate] commented 18th September 2024

Hi Carlos,
What type of columns are you using to return these values?
If you’re using GQIDateTimeColumns the actual Value in the GQICell will always be a DateTime in UTC time (enforced) but GQI should automatically assign a DisplayValue with the local time unless you manually specified something else.
If you’re using GQIStringColumns then you manually need to manage how the time is displayed, but there is no way to know the users local time at that point.

Feel free to share a code snippet to clarify what you tried so far.

Carlos Matheus [SLC] [DevOps Advocate] commented 18th September 2024

here are my columns, i’m using DateTime columns

public override GQIColumn[] GetColumns()
{
return new GQIColumn[]
{
new GQIDateTimeColumn(“Start Date”),
new GQIDateTimeColumn(“Start Time”),
new GQIDateTimeColumn(“End Time”),
new GQIDateTimeColumn(“End Date”),
};
}

and here is what im doing with the Datetimes

var startEventDateTime = startDatetime.Value.ToUniversalTime();
var endEventDateTime = endDatetime.Value.ToUniversalTime();

var row = new[]
{
new GQICell {Value = startEventDateTime, DisplayValue = startEventDateTime.ToString(“d”) },
new GQICell {Value = startEventDateTime, DisplayValue = startEventDateTime.ToString(“hh:mm tt”)},
new GQICell {Value = endEventDateTime, DisplayValue = endEventDateTime.ToString(“hh:mm tt”) },
new GQICell {Value = endEventDateTime, DisplayValue = endEventDateTime.ToString(“d”)},
};

the problem is that by doing that is changing the times and not showing the local time.

I will attach screenshots to the original question so I can show better the idea.

Ronald Gerard [SLC] [DevOps Advocate] commented 19th September 2024

I see. So if you’re specifying the DisplayValue like this, you take full control over which time zone is used.
The eventDateTime variables are all in UTC, so using ToString directly will format them in UTC as well.

In order to use a different time zone, you’ll need a TimeZoneInfo object representing that time zone (see: https://learn.microsoft.com/en-us/dotnet/standard/datetime/instantiate-time-zone-info).
Then you can convert your eventDateTimes like so:
var localEventTime = TimeZoneInfo.ConvertTimeFromUtc(eventDateTime, timeZoneInfo);
And then use localEventTime.ToString(“…”);

The limitation of this approach is that there is no easy way yet to know the actual local client time zone at this point. So either you have to hardcode the time zone or select it using an input argument.

You are viewing 1 out of 1 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