DateTime Ticks ↔ Date Converter
Convert a .NET DateTime tick value to UTC, local time, ISO 8601, and Unix time — or convert a date and timezone back to ticks, with a ready-to-paste C# DateTime constructor.
What this tool does
Paste a .NET DateTime.Ticks value to see the UTC date, local date, ISO 8601 string, DateTimeOffset representation, and Unix seconds/milliseconds it represents — or switch direction to enter a date, time, and timezone and get the equivalent tick value, plus a ready-to-paste new DateTime(...) constructor. Everything runs in your Blazor Server session; nothing is sent to an external API.
How .NET ticks work
A .NET tick is 100 nanoseconds (one ten-millionth of a second). DateTime.Ticks counts the number of ticks that have elapsed since 0001-01-01 00:00:00 UTC — the value of DateTime.MinValue, which is tick 0. This is the single most common source of confusion: ticks are not Unix time (which counts seconds since 1970-01-01) and are not milliseconds — they're a much finer-grained count from a much older epoch.
// DateTime.UnixEpoch.Ticks is a documented BCL constant:
new DateTime(621355968000000000L, DateTimeKind.Utc)
// == 1970-01-01T00:00:00.0000000Z (Unix time 0)
// DateTime.MinValue.Ticks == 0
new DateTime(0L, DateTimeKind.Utc)
// == 0001-01-01T00:00:00.0000000Z
// DateTime.MaxValue.Ticks == 3155378975999999999
new DateTime(3155378975999999999L, DateTimeKind.Utc)
// == 9999-12-31T23:59:59.9999999Z
Edge cases this tool handles explicitly
| Input | Result |
|---|---|
0 | DateTime.MinValue (0001-01-01 00:00:00 UTC) — the earliest valid tick value. |
3155378975999999999 (DateTime.MaxValue.Ticks) | DateTime.MaxValue (9999-12-31 23:59:59.9999999 UTC) — the latest valid tick value. |
| Any negative number | Rejected with an explicit error — negative ticks have no corresponding DateTime; .NET's tick count only goes forward from year 1. |
Any value above DateTime.MaxValue.Ticks | Rejected with an explicit error naming the exact limit, rather than throwing an unhandled ArgumentOutOfRangeException. |
| Non-numeric text | Rejected with a message that echoes back what you typed, so a stray character or copy-paste artifact is easy to spot. |
SQL Server ticks are not the same thing
SQL Server doesn't expose a "ticks" concept in T-SQL at all — Ticks is a CLR/.NET-only property. If you've computed something you're calling "SQL ticks," it's almost certainly from the legacy datetime (or smalldatetime) column type, and it will not match a .NET tick value for the same instant: the legacy datetime type stores time as whole days since 1900-01-01 plus a fractional-day count with roughly 3.33 ms resolution (1/300 of a second) — a completely different epoch and a ~30,000x coarser resolution than .NET's 100ns ticks from year 1. The newer datetime2 type does use 100ns resolution like .NET, but it still has no exposed "ticks" property in T-SQL — if you need to persist a raw .NET tick value, store it as a bigint column and convert with new DateTime(ticks, DateTimeKind.Utc) on the way back out.
How to use this tool
- Pick a direction with the mode toggle above the input.
- Ticks → DateTime: paste a tick value — conversion happens as you type.
- DateTime → Ticks: enter a date, time, and timezone (defaults to UTC) — conversion happens as you change any field.
- Copy the ready-to-paste C#
DateTimeconstructor from the output panel.
Looking for how to convert C# ticks to date in code instead of online? new DateTime(ticks, DateTimeKind.Utc) is the one-liner — this page exists so you can check the result before you paste it.
| UTC | 2024-04-29 15:06:40.0000000 UTC |
| Local | 2024-04-29 15:06:40.0000000 +00:00 |
| ISO 8601 | 2024-04-29T15:06:40.0000000Z |
| DateTimeOffset | 2024-04-29 15:06:40.0000000 +00:00 |
| Unix seconds | 1714403200 |
| Unix milliseconds | 1714403200000 |
Copy as C# code
C# DateTime constructor
new DateTime(638500000000000000L, DateTimeKind.Utc)