DateTime

Shows the date and time.

# Properties

[{"index":"int32 Day","0":"DateTime's day component."}]

[{"index":"DayOfWeekType DayOfWeek (ReadOnly)","0":"DateTime's day of the week component."}]

[{"index":"integer Elapsed","0":"An integer in milliseconds, which composes DateTime."}]

[{"index":"int32 Hour","0":"DateTime's time component."}]

[{"index":"int32 Millisecond","0":"DateTime's millisecond component."}]

[{"index":"int32 Minute","0":"DateTime's minute component."}]

[{"index":"int32 Month","0":"DateTime's month component."}]

[{"index":"int32 Second","0":"DateTime's second component."}]

[{"index":"int32 Year","0":"DateTime's year component."}]

[{"index":"DateTime MaxValue (Static) (ReadOnly)","0":"Shows the maximum DateTime value."}]

[{"index":"DateTime MinValue (Static) (ReadOnly)","0":"Shows the minimum DateTime value."}]

[{"index":"DateTime UtcNow (Static) (ReadOnly)","0":"Shows the DateTime value representing the current date and time based on UTC."}]

# Constructors

[{"index":"DateTime(int32 year, int32 month, int32 day)","0":"Initializes to the designated year, month, and day."}]

[{"index":"DateTime(int32 year, int32 month, int32 day, int32 hour, int32 minute, int32 second)","0":"Initializes to the designated year, month, day, hour, minute, and second."}]

[{"index":"DateTime(int32 year, int32 month, int32 day, int32 hour, int32 minute, int32 second, int32 millisecond)","0":"Initializes to the designated year, month, day, hour, minute, second, and millisecond."}]

[{"index":"DateTime(integer elapsed)","0":"Initializes to an integer in milliseconds."}]

[{"index":"DateTime(string dateTimeString)","0":"Initializes to the string for the designated date and time."}]

[{"index":"DateTime(string dateTimeString, string format)","0":"Initializes to the string for the designated date and time. The string format must exactly match the designated format. The DateTime format specifier can be included in the format."}]

[{"index":"DateTime(string dateTimeString, string format, string cultureName)","0":"Initializes the string to the designated date and time. The string format must exactly match the designated format. The DateTime format specifier can be included in the format."}]

# Methods

[{"index":"boolean IsLocalTime()","0":"Returns whether DateTime is LocalDateTime."}]

[{"index":"string ToFormattedString(string format)","0":"Converts DateTime into a string and returns it. The standard DateTime format specifier or custom DateTime format specifier can be included in the format."}]

[{"index":"string ToFormattedString(string format, string cultureName)","0":"Converts DateTime into a string and returns it. The standard DateTime format specifier or custom DateTime format specifier can be included in the format. cultureName is a cultural area name, and it follows the standards defined in BCP 47."}]

# Operators

[{"index":"DateTime Addition(DateTime left, TimeSpan right) (Static)","0":"Returns a new DateTime value by adding the specified right value and left value together."}]

[{"index":"boolean Equality(DateTime left, DateTime right) (Static)","0":"Checks if the two values are the same."}]

[{"index":"boolean GreaterThan(DateTime left, DateTime right) (Static)","0":"Checks if the specified left value is later than the right value."}]

[{"index":"boolean GreaterThanOrEqual(DateTime left, DateTime right) (Static)","0":"Checks if specified left value is equal to or later than the right value."}]

[{"index":"boolean Inequality(DateTime left, DateTime right) (Static)","0":"Checks if the two values are different."}]

[{"index":"boolean LessThan(DateTime left, DateTime right) (Static)","0":"Checks if the specified left value is earlier than the right value."}]

[{"index":"boolean LessThanOrEqual(DateTime left, DateTime right) (Static)","0":"Checks if the specified left value is equal to or earlier than the right value."}]

[{"index":"TimeSpan Subtraction(DateTime left, DateTime right) (Static)","0":"Determines a new TimeSpan value by subtracting the specified right value from the left value."}]

[{"index":"DateTime Subtraction(DateTime left, TimeSpan right) (Static)","0":"Returns a new DateTime value by subtracting the specified right value from the left value."}]

# SeeAlso

  * [Utilizing Date and Time](/docs?postId=691)