ClockMath

DateTime to C# Ticks Converter

Type a date on the right and get the matching .NET DateTime.Ticks value on the left. The fields stay in sync, so you can go either direction without switching pages.

C# Ticks(100-ns since 0001-01-01)
638501616000000000
Date (UTC)
Wednesday, May 1, 2024 at 12:00:00 UTC
ISO 8601(.NET "o" format)
2024-05-01T12:00:00.0000000Z
Unix seconds
1714564800
Unix milliseconds
1714564800000
ISO week(year-week-day)
2024-W18-3
Day of year(of 366)
122
Share this conversion:https://clockmath.rainofstars.app/ticks-to-datetime/638501616000000000

How this works

.NET's DateTime represents an instant as a 64-bit integer count of 100-nanosecond intervals (ticks) since 00:00:00 UTC on 1 January 0001 in the proleptic Gregorian calendar. To convert a date to ticks:

unixMilliseconds = Date.UTC(year, month - 1, day, hour, minute, second)
ticks            = BigInt(unixMilliseconds) * 10_000n + 621_355_968_000_000_000n

We perform the math in BigIntbecause typical ticks values exceed JavaScript's safe integer range (253−1), so the trailing 100-nanosecond digits are preserved exactly.

Common examples

  • 1970-01-01T00:00:00ZUnix epoch
  • 2000-01-01T00:00:00ZY2K
  • 2024-05-01T12:00:00ZFriday, 1 May 2024 (UTC)

Frequently asked questions

How are ticks calculated from a date?

Take the milliseconds between the date and 1970-01-01T00:00:00Z, multiply by 10,000 (the number of ticks per millisecond), and add 621,355,968,000,000,000 (the ticks-equivalent of the Unix epoch in .NET).

What timezone is used for the input?

If you enter an ISO 8601 string without a timezone designator, the converter treats it as UTC. To use a different offset, include it in the input (for example, '2024-05-01T12:00:00+10:00').

Can I include sub-millisecond precision in the input?

Yes. Use up to 7 fractional digits in the seconds component, e.g. '2024-05-01T12:00:00.0001234Z'. The converter uses BigInt arithmetic so no precision is lost.

Does this work with DateTimeOffset?

Yes. DateTimeOffset values carry an offset which the converter honours when parsing. The resulting ticks value matches what DateTimeOffset.UtcTicks would return in .NET.

Related tools