C# DateTime SpecifyKind

Description

DateTime SpecifyKind creates a new DateTime object that has the same number of ticks as the specified DateTime, but is designated as either local time, Coordinated Universal Time (UTC), or neither, as indicated by the specified DateTimeKind value.

Syntax

DateTime.SpecifyKind has the following syntax.


public static DateTime SpecifyKind(
  DateTime value,
  DateTimeKind kind
)

Parameters

DateTime.SpecifyKind has the following parameters.

  • value - A date and time.
  • kind - One of the enumeration values that indicates whether the new object represents local time, UTC, or neither.

Returns

DateTime.SpecifyKind method returns A new object that has the same number of ticks as the object represented by the value parameter and the DateTimeKind value specified by the kind parameter.





















Home »
  C# Tutorial »
    System »




Array
BitConverter
Boolean
Byte
Char
Console
ConsoleKeyInfo
Convert
DateTime
DateTimeOffset
Decimal
Double
Enum
Environment
Exception
Guid
Int16
Int32
Int64
Math
OperatingSystem
Random
SByte
Single
String
StringComparer
TimeSpan
TimeZone
TimeZoneInfo
Tuple
Tuple
Tuple
Type
UInt16
UInt32
UInt64
Uri
Version