Skip to main content

parse_dotnet_ticks

Function parse_dotnet_ticks 

Source
pub fn parse_dotnet_ticks(ticks: i64) -> Result<DateTime<Utc>, TimestampError>
Expand description

Parses a .NET ticks value into a UTC datetime.

.NET ticks are 100-nanosecond intervals since 0001-01-01T00:00:00. This function subtracts the .NET-to-Unix epoch offset and converts the remainder to a DateTime<Utc>.

§Errors

Returns TimestampError::OutOfRange if the ticks value cannot be represented as a valid DateTime<Utc>.