Synchronizes DateTime, DateTimeOffset and TimeSpan values as strings. By default the formats match Newtonsoft.Json: ISO-8601 for DateTime — written in one of three forms according to its DateTimeKind (see SyncDateTimeHelper.NewtonsoftDateFormat) — and for DateTimeOffset, and constant ("c") format for TimeSpan. A different format can be chosen via the constructor. All strings are written and parsed with the invariant culture.
More...
Source file:
Synchronizes DateTime, DateTimeOffset and TimeSpan values as strings. By default the formats match Newtonsoft.Json: ISO-8601 for DateTime — written in one of three forms according to its DateTimeKind (see SyncDateTimeHelper.NewtonsoftDateFormat) — and for DateTimeOffset, and constant ("c") format for TimeSpan. A different format can be chosen via the constructor. All strings are written and parsed with the invariant culture.
|
|
string | _preferredFormat |
| |
|
DateTimeStyles | _parseMode |
| |
|
| | SyncTimeAsString (string?preferredFormat=null, DateTimeStyles parseMode=DateTimeStyles.AllowWhiteSpaces) |
| |
|
string | ToString (DateTime value) |
| |
|
string | ToString (DateTimeOffset value) |
| |
|
string | ToString (TimeSpan value) |
| |
|
DateTime | ToDateTime (string?str) |
| |
|
DateTimeOffset | ToDateTimeOffset (string?str) |
| |
|
TimeSpan | ToTimeSpan (string?str) |
| |
|
DateTime | Sync (ref SM sync, FieldId name, DateTime value) |
| |
|
DateTime | Sync (ref SM sync, FieldId name, DateTime?value) |
| |
|
DateTimeOffset | Sync (ref SM sync, FieldId name, DateTimeOffset value) |
| |
|
DateTimeOffset | Sync (ref SM sync, FieldId name, DateTimeOffset?value) |
| |
|
TimeSpan | Sync (ref SM sync, FieldId name, TimeSpan value) |
| |
|
TimeSpan | Sync (ref SM sync, FieldId name, TimeSpan?value) |
| |
|
T | Sync (ref SyncManager sync, FieldId name, T?value) |
| |
| Loyc.SyncLib.Impl.SyncTimeAsString< SM >.SyncTimeAsString |
( |
string? |
preferredFormat = null, |
|
|
DateTimeStyles |
parseMode = DateTimeStyles.AllowWhiteSpaces |
|
) |
| |
|
inline |
- Parameters
-
| preferredFormat | The format used for writing, which is also tried first when parsing (parsing falls back on the standard Parse method of the value's type). If this is null, DateTime and DateTimeOffset use NewtonsoftDateFormat and TimeSpan uses constant ("c") format. |
| parseMode | Style flags used when parsing DateTime and DateTimeOffset (e.g. DateTimeStyles.RoundtripKind preserves the DateTimeKind of a DateTime). |