KGy SOFT

DateTimeExtensions Class

KGy SOFT Core Libraries Help
Provides extension methods for the DateTime type.
Inheritance Hierarchy

SystemObject
  KGySoft.CoreLibrariesDateTimeExtensions

Namespace:  KGySoft.CoreLibraries
Assembly:  KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 6.0.0
Syntax

public static class DateTimeExtensions

The DateTimeExtensions type exposes the following members.

Methods

  NameDescription
Public methodStatic memberAsLocal
Converts the specified dateTime to a local time. Unlike DateTime.ToLocalTime, this method does not treat DateTime instances with Unspecified Kind as UTC times.
Public methodStatic memberAsUtc
Converts the specified dateTime to UTC time. Unlike DateTime.ToUniversalTime, this method does not treat DateTime instances with Unspecified Kind as local times.
Public methodStatic memberFromUnixMilliseconds
Gets a Utc DateTime from the milliseconds elapsed since the Unix Epoch time (1970-01-01T00:00Z).
Public methodStatic memberFromUnixSeconds
Gets a Utc DateTime from the seconds elapsed since the Unix Epoch time (1970-01-01T00:00Z).
Public methodStatic memberToUnixMilliseconds
Gets the time elapsed since the Unix Epoch time (1970-01-01T00:00Z) in milliseconds, not counting leap seconds.
Public methodStatic memberToUnixSeconds
Gets the time elapsed since the Unix Epoch time (1970-01-01T00:00Z) in seconds, not counting leap seconds.
Top
See Also

Reference