This service is available via Telligent.Evolution.Extensibility.Apis.Get<Telligent.Evolution.Extensibility.Api.Version1.IDate>()
Properties
| Name | Type | Description | Default | Options |
|---|---|---|---|---|
| CurrentServerTime | DateTime | The current date and time in the host server's local timezone with a DateTimeKind of Local. | ||
| CurrentUniversalTime | DateTime | The current date and time in univeral time(Utc) with a DateTimeKind of Utc. | ||
| CurrentUserTime | DateTime | The current date and time in the accessing user's timezone with a DateTimeKind of Unspecifed. |
Methods
bool Compare(DateTime date1, string operation, DateTime date2);
Compares dates by first normalizing their timezones and then performing the requested comparison.
Parameters
| Name | Type | Description | Required | Default | Options |
|---|---|---|---|---|---|
| date1 | DateTime | Date1 | Required | ||
| operation | string | The comparison to make between the dates | Required | EarlierThan, EarlierThanOrEqualTo, EqualTo, LaterThan, LaterThanOrEqual, NotEqualTo | |
| date2 | DateTime | Date2 | Required |
Return Type
DateTime ToServerTime(DateTime inDate);
Convert a DateTime to be in the host server's local timezone. For timezone conversions, Community reviews the DateTime.Kind property where UTC = UTC, Local = host server's local timezone, and Unspecified = accessing user's timezone.
Parameters
| Name | Type | Description | Required | Default | Options |
|---|---|---|---|---|---|
| inDate | DateTime | In Date | Required |
Return Type
DateTime ToUniversalTime(DateTime inDate);
Convert a DateTime to be in UTC. For timezone conversions, Community reviews the DateTime.Kind property where UTC = UTC, Local = host server's local timezone, and Unspecified = accessing user's timezone.
Parameters
| Name | Type | Description | Required | Default | Options |
|---|---|---|---|---|---|
| inDate | DateTime | In Date | Required |
Return Type
DateTime ToUserTime(DateTime inDate);
Convert a DateTime to be in the accessing user's configured timezone. For timezone conversions, Community reviews the DateTime.Kind property where UTC = UTC, Local = host server's local timezone, and Unspecified = accessing user's timezone.
Parameters
| Name | Type | Description | Required | Default | Options |
|---|---|---|---|---|---|
| inDate | DateTime | In Date | Required |