Combine seconds and nanos into UTC

Turn Protobuf seconds and nanosecond fields into UTC time, even before 1970.

What you'll make

In Excel: 1793802615 s, 500000000 ns becomes 11/4/2026 14:30:15.500.

The formula

The formula, with a numbered bracket under each part.
NumberPartWhat it doesResult so far
1DATE(1970,1,1)The start date the days are added to.1/1/1970 00:00:00.000
2A8/86400Whole seconds turned into days: 86,400 in a day.11/4/2026 14:30:15.000
3B8/86400000000000Adds the nanoseconds as a tiny part of a day.11/4/2026 14:30:15.500

Read it left to right. Negative seconds go back before 1970, and the nanoseconds still add time.

=DATE(1970,1,1)+A8/86400+B8/86400000000000

How to use it

Yellow bar at the top? Click Enable Editing.

  1. See it work. The Example tab shows 20 made-up examples with the formula already in.
  2. Use your own fields. Paste each row's seconds and nanoseconds into the green columns of the Template tab. The UTC dates and times fill in by themselves.
  3. Move them into your letter. Copy the results. Then use Paste Special and choose Values.

Before you send

Paste the nanoseconds as they are, even before 1970: they always add time. Excel keeps about milliseconds, not every nanosecond.

Microsoft's help: DATE function