Hello Dojo,
I've had a few use cases recently related to how LCAs automatically convert DateTimes to the Client's TimeZone. What I'd like to know is if there is any way in an IAS or Ad Hoc Data Source to detect what the TimeZone we would be converting to. Very frequently, we see users try to use a script that requires a DateTime and they get confused as to what TimeZone the DateTime is in. I'd like to be able to determine and display that TimeZone as to avoid this confusion.
Thank you,
Bauti
Hi Bautista
It is possible to get the time zone or its offset in a IAS when a user selects a date and time in a time and calendar component. The methods GetClientTimeZoneInfo or GetClientDateTime on the UI result were introduced in DataMiner 10.5.4/10.6.0 for this purpose. They're also available in the toolkit using the ClientTimeZoneInfo and ClientDateTime properties. That information can then be displayed in another component.
However, this currently requires user interaction with the UI before the information becomes available. A feature request has been submitted to allow retrieving this information before displaying the UI and without requiring user interaction.
Would this approach cover your use case?
Kind regards
Hi Bautista,
I guess you should be able to be aware of the time zone you are providing from the script. For example, if you are getting dateTime from the connector column, you will be converting it to a DateTime object with DateTime.FromOADate(oaDateTime), after what you will maybe convert it local time with ToLocalTime(). In this case, you need to know the local time zone, which should be available in TimeZoneInfo.Local.
I hope this helps you a bit. Let me know if you had specific use case you would like to discuss.