Date and time

.NET ticks converterEvery 100 nanoseconds accounted for

Convert DateTime.Ticks and dates with seven fractional digits. Declare UTC or unspecified time before interpreting the result.

.NET ticks converter

Input

Your input is processed in this browser and is not sent to a server.

Results

Options

DateTime.Ticks only · epoch 0001-01-01 · 1 tick = 100 ns.

One decimal integer or YYYY-MM-DDTHH:mm:ss with optional 1–7 fractional digits per line. UTC accepts Z or ±HH:mm; no suffix means UTC. Unspecified accepts no suffix.

The number does not encode Kind. Unspecified preserves calendar fields without a Unix timestamp. A source Local value needs timezone context that this tool cannot infer.

Dates retain seven fractional digits. Unix seconds and milliseconds use floor division; their nonnegative remainders are measured in ticks.

Up to 1,000 physical lines and 100,000 UTF-16 code units. Empty lines are reported as errors.

Enter input or choose an example to begin.

Use the .NET ticks converter when a C# log contains a long integer and you need to see the date without losing its final digits. A database export may preserve precision that a millisecond-only viewer cannot show.

A number alone does not identify its epoch or timezone. Confirm that the source is DateTime.Ticks; a duration, hardware counter or Windows file time can look similar while meaning something entirely different.

Why use this .NET ticks converter?

Round trips keep the last digit

The .NET ticks converter turns 621355968000000001 into 1970-01-01T00:00:00.0000001Z in UTC mode. Reverse uses that complete date, so one tick does not disappear between decoding and encoding.

A fine ruler and magnified tick connect through a two-way path to a calendar and clock.

Leave unknown timezones unknown

An unspecified value describes clock fields, not a confirmed instant. Its output has no Z and no Unix section. This keeps a plausible-looking conversion from silently assigning a timezone to incomplete source data.

Matching clock faces branch from one count; only one branch is connected to a globe and timeline.

Check the origin before the calendar

01

Declare the source semantics

Use UTC for known UTC ticks or UtcTicks. For DateTimeOffset.Ticks, the missing Offset still matters: inspect the wall time as unspecified or supply a complete offset-bearing date in the reverse direction.

02

Use the precision example

Example previews the minimum date, Unix epoch plus one tick, and the maximum date. Apply it to inspect seven fractional digits; Undo restores the input and report you had before.

03

Choose when to refresh

Automatic conversion waits 350 ms after edits. Turn it off to use Convert or Ctrl/Cmd + Enter. Reverse is available only after every line succeeds; changing either option immediately disables stale exports.

Exact dates with an auditable batch report

Two exact directions

Convert DateTime ticks to date or date to ticks without a floating-point step. All exported large integers remain JSON strings, so a downstream JSON parser does not silently round them.

UTC normalization

A date with +08:00 is converted to the corresponding UTC instant before counting ticks. Dates without a suffix use the selected interpretation; the browser timezone does not enter the calculation.

Visible fractional remainders

Ticks to milliseconds can discard the fraction if only an integer is shown. Here the UTC report includes both Unix integer values and their tick remainders; a value just before 1970 remains negative.

Every physical line retained

Successful rows and errors coexist with their original input and line numbers. The preview starts at 50 rows; Show more adds 50, while Copy and Download always include the entire report.

What these integers can and cannot mean

One epoch, one unit
The epoch is Gregorian 0001-01-01 and the unit is 100 nanoseconds. No digit-count detection, FILETIME, WebKit, Excel serials, TimeSpan durations, Stopwatch counters, Environment.TickCount, rowversion or DateTime.ToBinary decoding.
A bounded DateTime range
Accepted ticks run from 0 to 3155378975999999999. Dates use four-digit years 0001–9999; an offset that moves the normalized UTC date outside that range is rejected, even if the entered wall date is in range.
Strict calendar input
Use YYYY-MM-DDTHH:mm:ss, with T or one space, optional 1–7 fractional digits, and optional Z or ±HH:mm. Reject leap seconds, 24:00, impossible dates, date-only input and extra fractional digits. No silent rounding or trimming.
No inferred local timezone
UTC offsets are limited to ±14:00 and -00:00 is rejected as unknown. Unspecified rejects all suffixes, including Z. Switching semantics reinterprets the fields; it does not convert Local time or recover Kind, an IANA zone or DST rules.
Whole-batch limits
Allow at most 1,000 physical lines and 100,000 UTF-16 code units. Blank lines, including a final newline, remain errors. Exceeding either limit rejects the whole batch. File import, URL fetching, date arithmetic and a live clock are outside this page.
Reversal uses exact results
Reverse never uses rounded Unix milliseconds and never skips bad rows. Example, Clear and Reverse require a replacement preview and Apply, then allow one Undo that restores input, options and results together.

.NET ticks converter questions

How can I convert ticks to a date?

Choose Ticks → date and declare the interpretation, then enter the integer. In C#, new DateTime(ticks) recreates the clock fields with Kind.Unspecified; use the constructor accepting DateTimeKind.Utc when you know the stored ticks represent UTC.

Why do DateTime ticks depend on the timezone?

Ticks count the DateTime clock fields, while Kind describes their meaning. DateTime.Now and its ToUniversalTime() value can therefore have different tick counts for the same instant. The integer returned by Ticks does not preserve the Kind flag.

How do I get milliseconds from ticks?

There are 10,000 ticks per millisecond. Dividing a DateTime tick count by 10,000 gives milliseconds since year 1, not Unix milliseconds. For UTC, first subtract 621355968000000000, then divide; inspect the remainder if submillisecond precision matters.

Can I store DateTime.Now.Ticks in an int without losing precision?

A modern DateTime tick count does not fit a 32-bit int. Use a 64-bit long in .NET and preserve the value as a string when crossing systems that parse JSON numbers as floating point. An offset from a chosen base only works with an explicitly limited range.

Why does DateTime use ticks instead of milliseconds?

Ticks express a 100 ns increment and can represent the supported year range in a 64-bit value. That representation is finer than milliseconds, but it does not guarantee that the system clock measures a new instant every 100 ns.

Unexpected result?

Inspect the original value

Use the .NET ticks converter to compare a known value with its precise calendar date, then retain the complete report and declared semantics alongside your source data.