Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

class NodaTime.​Extensions.​DateTimeExtensions

Assembly: NodaTime

Inheritance: object → DateTimeExtensions

Extension methods for <see cref="T:System.DateTime" /> .

Methods

public static LocalDateTime
ToLocalDateTime​(System.​DateTime dateTime)
Converts a <see cref="T:System.DateTime" /> of any kind to <see cref="T:NodaTime.LocalDateTime" /> .
Returns A new <see cref="T:NodaTime.LocalDateTime" /> with the same values as <paramref name="dateTime" /> .
dateTime The <c>DateTime</c> to convert.
Remarks This is a convenience method which calls <see cref="M:NodaTime.LocalDateTime.FromDateTime(System.DateTime)" /> .
public static Instant
ToInstant​(System.​DateTime dateTime)
Converts a <see cref="T:System.DateTime" /> with a kind of <see cref="F:System.DateTimeKind.Utc" /> into an <see cref="T:NodaTime.Instant" /> .
Returns An <see cref="T:NodaTime.Instant" /> value representing the same instant in time as <paramref name="dateTime" /> .
dateTime The <c>DateTime</c> to convert.
Remarks This is a convenience method which calls <see cref="M:NodaTime.Instant.FromDateTimeUtc(System.DateTime)" /> .
public bool
Equals​(object obj)
Inherited from object
protected void
Finalize​()
Inherited from object
public int
GetHashCode​()
Inherited from object
GetType​()
Inherited from object
protected object
MemberwiseClone​()
Inherited from object
public string
ToString​()
Inherited from object