Skip to main content

RtcDateTime Struct

NuGet: GHIElectronics.TinyCLR.Devices.Rtc
Assembly: GHIElectronics.TinyCLR.Devices.Rtc
Namespace: GHIElectronics.TinyCLR.Devices.Rtc

RTC-native calendar time representation. Mirrors the underlying hardware registers — most app code should round-trip through ToDateTime / FromDateTime(DateTime) rather than touching fields directly.

public struct RtcDateTime

Methods​

ToDateTime()​

public DateTime ToDateTime()

Converts this RtcDateTime to a managed DateTime.

Returns DateTime

FromDateTime(DateTime value)​

public static RtcDateTime FromDateTime(DateTime value)

Builds an RtcDateTime from a managed DateTime.

ParameterTypeDescription
valueDateTimeCalendar time to convert.

Returns RtcDateTime

Fields​

Year​

public int Year

Calendar year (e.g. 2026).

Month​

public int Month

Month, 1..12.

Week​

public int Week

ISO week-of-year (platform-dependent; may be unset).

DayOfYear​

public int DayOfYear

Day-of-year, 1..366.

DayOfMonth​

public int DayOfMonth

Day-of-month, 1..31.

DayOfWeek​

public int DayOfWeek

Day-of-week (0 = Sunday).

Hour​

public int Hour

Hour, 0..23.

Minute​

public int Minute

Minute, 0..59.

Second​

public int Second

Second, 0..59.

Millisecond​

public int Millisecond

Millisecond, 0..999.

Microsecond​

public int Microsecond

Microsecond component, 0..999.

Nanosecond​

public int Nanosecond

Nanosecond component (rounded to 100 ns), 0..900.