Table of Contents

Method GetClientDateTime

Namespace
Skyline.DataMiner.Automation
Assembly
SLManagedAutomation.dll

GetClientDateTime(string)

Gets the date/time that was selected for the specified destination variable, as displayed in the client, which is linked to a Calendar and Time item. If the client date/time is not available, e.g. when ClientTimeInfo is set to Disabled, the returned value will be MinValue.

public DateTimeOffset GetClientDateTime(string key)

Parameters

key string

The name of the destination variable.

Returns

DateTimeOffset

The date/time that was selected for the specified destination variable, as displayed in the client, which is linked to a Calendar and Time item.

Examples

var selection = DateTime.Now;
...
var blockCalendar = new UIBlockDefinition
{
  Type = UIBlockType.Calendar,
  InitialValue = selection.ToString(AutomationConfigOptions.GlobalDateTimeFormat),
  DestVar = "calendar",
  WantsOnChange = true,
  ClientTimeInfo = UIClientTimeInfo.Return,
};
uib.AppendBlock(blockCalendar);
...
var uir = engine.ShowUI(uib);
...
var clientDateTime = uir.GetClientDateTime(blockCalendar.DestVar);
var displayedDateTime = clientDateTime.DateTime;

Remarks

note

Available from DataMiner 10.5.4/10.6.0 onwards.

tip

The returned date/time includes the offset to UTC. To get the date as displayed in the client, use the Date property on the returned value. To get the time as displayed in the client, use the TimeOfDay property on the returned value.