Time
Calendar data, system clocks and monotonic interval measurement.
Use epoch seconds for event dates and differences of GetTicksUsec()/GetTicksMsec() for elapsed intervals. System clocks can change; runtime ticks are not dates and cannot be carried across runs. A microsecond unit promises no microsecond precision.
Unix conversions here use integer seconds and apply no local zone. System-method utc selects UTC or local. GetTimeZoneFromSystem() bias is measured in minutes and describes the current OS zone rather than every historical date.
String methods do not replace a strict ISO/RFC3339 parser: timezone suffixes are not converted, fractions are lost, and empty input can become epoch. The Dictionary parser does not validate all calendar ranges. Validate before conversion; 0 and −1 alone do not prove errors.
Source uses a proleptic Gregorian calendar without historical skipped days; leap seconds are unsupported. Fixed Windows roundtrips, schemas, defaults and ticks were tested. DST transitions, clock changes, extreme dates and other platforms were not executed.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Properties1
SingletonProperty
public static TimeInstance Singleton { get; }Borrowed wrapper of the global Time service. Repeated access uses a cached wrapper; do not Free/Dispose it. Use static methods for ordinary calls.
Methods21
GetDateDictFromSystemReckfell.Collections.Dictionary
public static Reckfell.Collections.Dictionary GetDateDictFromSystem(bool utc = false);Reads current OS year, month, day and weekday. utc=false selects local time; true selects UTC. A separate system-clock snapshot; other calls can cross a day boundary. Contains neither hour nor dst.
| Name | Type | Default |
|---|---|---|
utc | bool | false |
utcTrue reads UTC; false (default) reads the current local OS zone. Not a Unix-conversion parameter.
Reckfell.Collections.DictionaryNew Dictionary of the specified fields; dispose the owned C# wrapper after reading.
GetDateDictFromUnixTimeReckfell.Collections.Dictionary
public static Reckfell.Collections.Dictionary GetDateDictFromUnixTime(long unixTimeVal);Converts integer Unix seconds to year/month/day/weekday without a local-timezone shift. Month is 1…12; weekday 0 is Sunday. Negative seconds allow pre-epoch dates. Not a full datetime or an OS-setting change.
| Name | Type | Default |
|---|---|---|
unixTimeVal | long | — |
unixTimeValInteger signed seconds since 1970-01-01T00:00:00, not milliseconds; no local offset is applied.
Reckfell.Collections.DictionaryNew Dictionary of the specified fields; dispose the owned C# wrapper after reading.
GetDateStringFromSystemstring
public static string GetDateStringFromSystem(bool utc = false);Returns current OS date as YYYY-MM-DD. utc selects local/UTC; the string contains no offset or zone name. Not a localized user-interface date format.
| Name | Type | Default |
|---|---|---|
utc | bool | false |
utcTrue reads UTC; false (default) reads the current local OS zone. Not a Unix-conversion parameter.
stringString in the specified calendar format without timezone conversion or fractions.
GetDateStringFromUnixTimestring
public static string GetDateStringFromUnixTime(long unixTimeVal);Formats integer Unix seconds as YYYY-MM-DD without applying the local zone. Accepts no fractional part because the argument is long. Use ticks rather than calendar strings for elapsed intervals.
| Name | Type | Default |
|---|---|---|
unixTimeVal | long | — |
unixTimeValInteger signed seconds since 1970-01-01T00:00:00, not milliseconds; no local offset is applied.
stringString in the specified calendar format without timezone conversion or fractions.
GetDatetimeDictFromDatetimeStringReckfell.Collections.Dictionary
public static Reckfell.Collections.Dictionary GetDatetimeDictFromDatetimeString(string datetime, bool weekday);Parses components in YYYY-MM-DDTHH:MM:SS form, space instead of T, date-only or time-only. Missing parts use epoch defaults. C# requires weekday explicitly; true adds computed weekday. Not a validator: in 1.0.0 this method does not validate calendar/clock ranges and can return invalid fields. Validate before calling, especially with weekday=true; invalid months with weekday computation were not executed. Offset/Z suffixes and fractions are not full ISO support.
| Name | Type | Default |
|---|---|---|
datetime | string | — |
weekday | bool | — |
datetimePrevalidated component string; do not rely on strict ISO validation/offset conversion.
weekdayTrue adds computed weekday; first ensure a valid date. Required explicitly in C#.
Reckfell.Collections.DictionaryNew Dictionary of the specified fields; dispose the owned C# wrapper after reading.
GetDatetimeDictFromSystemReckfell.Collections.Dictionary
public static Reckfell.Collections.Dictionary GetDatetimeDictFromSystem(bool utc = false);Reads current OS year, month, day, weekday, hour, minute, second and dst. The flag selects UTC; utc=false is local. dst describes the current OS snapshot rather than a historical arbitrary date. System clocks can change, so do not use this for elapsed timing.
| Name | Type | Default |
|---|---|---|
utc | bool | false |
utcTrue reads UTC; false (default) reads the current local OS zone. Not a Unix-conversion parameter.
Reckfell.Collections.DictionaryNew Dictionary of the specified fields; dispose the owned C# wrapper after reading.
GetDatetimeDictFromUnixTimeReckfell.Collections.Dictionary
public static Reckfell.Collections.Dictionary GetDatetimeDictFromUnixTime(long unixTimeVal);Converts integer epoch seconds to seven fields: year/month/day/weekday/hour/minute/second. Adds no dst, offset or milliseconds and applies no local-zone settings. Tested negative and post-2038 timestamps; extreme int64 dates were not accepted.
| Name | Type | Default |
|---|---|---|
unixTimeVal | long | — |
unixTimeValInteger signed seconds since 1970-01-01T00:00:00, not milliseconds; no local offset is applied.
Reckfell.Collections.DictionaryNew Dictionary of the specified fields; dispose the owned C# wrapper after reading.
GetDatetimeStringFromDatetimeDictstring
public static string GetDatetimeStringFromDatetimeDict(Reckfell.Collections.Dictionary datetime, bool useSpace);Formats a nonempty Dictionary as YYYY-MM-DDTHH:MM:SS or with a space. Missing year/month/day/hour/minute/second use epoch defaults; extra weekday/dst/bias do not convert zones. Checks date/time ranges, but failure produces an empty string with diagnostics rather than an Error. Invalid-field validation was source-reviewed only.
| Name | Type | Default |
|---|---|---|
datetime | Reckfell.Collections.Dictionary | — |
useSpace | bool | — |
datetimeNonempty year/month/day/hour/minute/second Dictionary; missing fields have epoch defaults.
useSpaceTrue replaces T with a space; changes no date, zone or precision.
stringString in the specified calendar format without timezone conversion or fractions.
GetDatetimeStringFromSystemstring
public static string GetDatetimeStringFromSystem(bool utc = false, bool useSpace = false);Formats current OS datetime with fields through integer seconds. utc selects the zone and useSpace only the separator. Contains no Z/offset and describes no clock monotonicity. Multiple calls are not one atomic snapshot.
| Name | Type | Default |
|---|---|---|
utc | bool | false |
useSpace | bool | false |
utcTrue reads UTC; false (default) reads the current local OS zone. Not a Unix-conversion parameter.
useSpaceTrue replaces T with a space; changes no date, zone or precision.
stringString in the specified calendar format without timezone conversion or fractions.
GetDatetimeStringFromUnixTimestring
public static string GetDatetimeStringFromUnixTime(long unixTimeVal, bool useSpace = false);Formats integer Unix seconds without a local shift. useSpace changes T to a space rather than the timezone. Includes no offset/Z or fractional seconds; do not append an arbitrary offset without a separate correct conversion.
| Name | Type | Default |
|---|---|---|
unixTimeVal | long | — |
useSpace | bool | false |
unixTimeValInteger signed seconds since 1970-01-01T00:00:00, not milliseconds; no local offset is applied.
useSpaceTrue replaces T with a space; changes no date, zone or precision.
stringString in the specified calendar format without timezone conversion or fractions.
GetOffsetStringFromOffsetMinutesstring
public static string GetOffsetStringFromOffsetMinutes(long offsetMinutes);Formats signed minutes as ±HH:MM: 330 → +05:30 and −210 → −03:30. Converts no timestamp, selects no DST and validates no timezone existence. Do not pass Unix seconds instead of minutes.
| Name | Type | Default |
|---|---|---|
offsetMinutes | long | — |
offsetMinutesSigned offset minutes; 330 represents +05:30. Not a Unix timestamp.
stringSigned ±HH:MM offset string without date conversion.
GetTicksMseculong
public static ulong GetTicksMsec();Monotonic millisecond counter for the current runtime. Useful for differences between readings; not a date or epoch. Current backend truncates microseconds/1000. Do not persist as portable time across runs or assume 1 ms scheduler precision.
ulongNonnegative runtime milliseconds, not epoch.
GetTicksUseculong
public static ulong GetTicksUsec();Monotonic microsecond counter since this runtime started. Use (now−start)/1_000_000.0 for elapsed seconds. The unit does not guarantee physical 1 µs precision. Not UTC, Engine.TimeScale-adjusted game time or a shared timestamp across processes.
ulongNonnegative runtime microseconds, not epoch.
GetTimeDictFromSystemReckfell.Collections.Dictionary
public static Reckfell.Collections.Dictionary GetTimeDictFromSystem(bool utc = false);Returns current OS hour/minute/second. utc=false is local and true is UTC. Contains no date/offset: equal values can occur on different days; not a unique event timestamp.
| Name | Type | Default |
|---|---|---|
utc | bool | false |
utcTrue reads UTC; false (default) reads the current local OS zone. Not a Unix-conversion parameter.
Reckfell.Collections.DictionaryNew Dictionary of the specified fields; dispose the owned C# wrapper after reading.
GetTimeDictFromUnixTimeReckfell.Collections.Dictionary
public static Reckfell.Collections.Dictionary GetTimeDictFromUnixTime(long unixTimeVal);Returns hour/minute/second within the day from an integer epoch timestamp without a timezone shift. −1 yields 23:59:59 rather than negative components. The result contains no date.
| Name | Type | Default |
|---|---|---|
unixTimeVal | long | — |
unixTimeValInteger signed seconds since 1970-01-01T00:00:00, not milliseconds; no local offset is applied.
Reckfell.Collections.DictionaryNew Dictionary of the specified fields; dispose the owned C# wrapper after reading.
GetTimeStringFromSystemstring
public static string GetTimeStringFromSystem(bool utc = false);Formats current OS time as HH:MM:SS in the selected local/UTC zone. Includes no date, fractions or offset. Not for precise elapsed-duration measurement.
| Name | Type | Default |
|---|---|---|
utc | bool | false |
utcTrue reads UTC; false (default) reads the current local OS zone. Not a Unix-conversion parameter.
stringString in the specified calendar format without timezone conversion or fractions.
GetTimeStringFromUnixTimestring
public static string GetTimeStringFromUnixTime(long unixTimeVal);Formats the day-time portion of integer Unix seconds as HH:MM:SS. Applies no local zone and retains no day information. A time-of-day representation rather than a duration string.
| Name | Type | Default |
|---|---|---|
unixTimeVal | long | — |
unixTimeValInteger signed seconds since 1970-01-01T00:00:00, not milliseconds; no local offset is applied.
stringString in the specified calendar format without timezone conversion or fractions.
GetTimeZoneFromSystemReckfell.Collections.Dictionary
public static Reckfell.Collections.Dictionary GetTimeZoneFromSystem();Reads current OS bias and name. bias is signed UTC-offset minutes; name is an OS name rather than a guaranteed IANA ID. Windows includes the current standard/DST adjustment. Not a historical timezone database or arbitrary-date DST conversion API. QA changed no zone and checked the result schema.
Reckfell.Collections.DictionaryNew Dictionary of the specified fields; dispose the owned C# wrapper after reading.
GetUnixTimeFromDatetimeDictlong
public static long GetUnixTimeFromDatetimeDict(Reckfell.Collections.Dictionary datetime);Converts a nonempty Dictionary to integer epoch seconds. Missing main fields use epoch defaults; weekday/dst/bias are ignored as conversion inputs. Local time is not automatically converted to UTC. Invalid ranges/empty Dictionary return 0 with native diagnostics; 0 is also the valid epoch, so this is not TryParse.
| Name | Type | Default |
|---|---|---|
datetime | Reckfell.Collections.Dictionary | — |
datetimeNonempty year/month/day/hour/minute/second Dictionary; missing fields have epoch defaults.
longInteger epoch seconds; 0 is ambiguous between epoch and a diagnosed error.
GetUnixTimeFromDatetimeStringlong
public static long GetUnixTimeFromDatetimeString(string datetime);Parses supported components into integer seconds. Not a strict ISO/RFC3339 parser: +03:00 does not subtract three hours, fractions are not preserved, and an empty string yielded 0. Date-only means midnight; time-only uses 1970-01-01. Validate structure/ranges and handle timezone separately. Error branches return −1 or 0 with diagnostics; both numbers are also valid timestamps.
| Name | Type | Default |
|---|---|---|
datetime | string | — |
datetimePrevalidated component string; do not rely on strict ISO validation/offset conversion.
longInteger epoch seconds; −1 and 0 are not universal error markers.
GetUnixTimeFromSystemdouble
public static double GetUnixTimeFromSystem();Current UTC epoch seconds from the system clock as double, possibly fractional. Not milliseconds. User/OS clock changes mean differences are not monotonic measurements. Use ticks for elapsed duration and explicitly choose UTC/local for display. Windows read-only behavior was tested without changing the clock.
doubleSystem UTC epoch seconds as double; can change nonmonotonically.
Time.Month
| Value | Description |
|---|---|
April = 4 | The month of April, represented numerically as |
August = 8 | The month of August, represented numerically as |
December = 12 | The month of December, represented numerically as |
February = 2 | The month of February, represented numerically as |
January = 1 | The month of January, represented numerically as |
July = 7 | The month of July, represented numerically as |
June = 6 | The month of June, represented numerically as |
March = 3 | The month of March, represented numerically as |
May = 5 | The month of May, represented numerically as |
November = 11 | The month of November, represented numerically as |
October = 10 | The month of October, represented numerically as |
September = 9 | The month of September, represented numerically as |
Time.Weekday
| Value | Description |
|---|---|
Friday = 5 | The day of the week Friday, represented numerically as |
Monday = 1 | The day of the week Monday, represented numerically as |
Saturday = 6 | The day of the week Saturday, represented numerically as |
Sunday = 0 | The day of the week Sunday, represented numerically as |
Thursday = 4 | The day of the week Thursday, represented numerically as |
Tuesday = 2 | The day of the week Tuesday, represented numerically as |
Wednesday = 3 | The day of the week Wednesday, represented numerically as |