Convert Milliseconds Timestamp to DateTime in LibreOffice: A Comprehensive Guide

Abstract: Convert millisecond Unix timestamps to LibreOffice Calc DateTime using the formula =A2/86400000+25569.

Created: 2026-10-09 by
To convert a millisecond timestamp to a DateTime in LibreOffice Calc, you must divide the timestamp by 86,400,000 (the number of milliseconds in a day) and add the Unix epoch start date. This calculation transforms the raw numeric value into a serial date number that LibreOffice can interpret as a calendar date and time.

Understanding the Millisecond Timestamp

A millisecond timestamp represents the total number of milliseconds elapsed since January 1, 1970, at 00:00:00 UTC, known as the Unix Epoch. In LibreOffice Calc, dates are stored as serial numbers where the integer part represents the number of days since December 30, 1899, and the fractional part represents the time of day. Because these two systems use different base dates and units, a direct conversion is not possible without a mathematical adjustment. You need to bridge the gap between the Unix Epoch and LibreOffice's internal date system while converting the unit from milliseconds to days.

The Conversion Formula

The core of the conversion lies in dividing the timestamp by the number of milliseconds in a single day. There are 1,000 milliseconds in a second, 60 seconds in a minute, 60 minutes in an hour, and 24 hours in a day. Multiplying these values gives us 86,400,000 milliseconds per day. By dividing your timestamp cell by this constant, you obtain the number of days since the Unix Epoch. However, because LibreOffice uses December 30, 1899, as its zero date rather than January 1, 1970, you must also add the number of days between these two epochs. The difference is approximately 25,569 days. Therefore, the complete formula structure involves dividing the source value by 86,400,000 and adding 25,569.

Step-by-Step Implementation in Calc

Follow these steps to apply the conversion in your spreadsheet. Ensure that your timestamp data is located in column A, starting at row 2, with headers in row 1.
  1. Select the Target Cell: Click on cell B2, which will hold the converted DateTime value for the first entry.
  2. Enter the Formula: Type the following formula exactly as shown, replacing A2 with the actual reference to your timestamp cell: =A2/86400000+25569. This formula performs the division and adds the epoch offset simultaneously.
  3. Apply Date Formatting: Right-click the cell B2 and select Format Cells. Navigate to the Numbers tab and choose Date or Time depending on whether you want to see both or just one component. If you need both, select a custom format like YYYY-MM-DD HH:MM:SS.
  4. Fill Down: Copy the cell B2 and paste it down the column to apply the conversion to all other timestamps. Alternatively, double-click the fill handle (the small square at the bottom right of the selection) to auto-fill to the last row of adjacent data.
If you encounter issues with the output displaying as a series of hashes (#####), it usually means the column width is too narrow to display the formatted date. Simply widen column B to resolve this visual issue. For more complex table references, consider reviewing how to transform formula field references properly, as seen in our guide on Transforming Formula Field Reference to Table Reference in LibreOffice Calc.

Handling Time Zones

Unix timestamps are inherently based on Coordinated Universal Time (UTC). If your data originates from a specific time zone, you may need to adjust the result to reflect local time. LibreOffice does not have a built-in function to automatically detect or convert time zones within standard formulas without using scripts or external libraries. To manually adjust for a time zone offset, you can add or subtract hours from the result. Since one day equals 24 hours, one hour equals 1/24th of a day. To add 5 hours for a UTC+5 time zone, modify the formula to: =A2/86400000+25569+5/24. Subtract the fraction if you are moving to a negative offset. Be cautious when dealing with Daylight Saving Time transitions, as manual adjustments do not account for these shifts automatically.

Importing CSV Data Correctly

Often, the difficulty arises not from the formula but from how the data is imported. When importing CSV files containing timestamps, LibreOffice might treat them as text or generic numbers. If your cells show the timestamp as text, the formula will return an error. You must ensure the column type is recognized as a number during import. Use the Text Import dialog to explicitly set the column type to "Standard" or "Date" if applicable, though "Standard" is safest for raw timestamps. For detailed instructions on managing column types during import, refer to our article on Changing CSV Column Types. This prevents parsing errors before you even attempt to apply the conversion formula.

Common Errors and Troubleshooting

If the formula returns a #DIV/0! error, check for empty cells in the source column. The divisor cannot be zero, so empty cells cause division failures. Wrap your formula in an IF statement to handle blanks gracefully: =IF(A2="","",A2/86400000+25569). Another common issue is the #NAME? error, which indicates a typo in the formula or language settings. Ensure that your formula syntax matches your LibreOffice language configuration. In some European versions, commas might be replaced by semicolons as argument separators, although this specific formula has no arguments requiring separators. Always verify that the cell containing the timestamp is indeed numeric. If it contains hidden characters or spaces, use the TRIM function to clean the data first.

Frequently Asked Questions

Why does my converted date show as a random year?

This happens if you forget to add the epoch offset of 25,569 days. Without this addition, LibreOffice calculates the date relative to December 30, 1899, resulting in a date far in the past or future depending on the magnitude of the timestamp. Always include the +25569 component to align with the correct calendar era.

Can I convert seconds instead of milliseconds?

Yes, simply change the divisor. For seconds, divide by 86,400 (seconds in a day) instead of 86,400,000. The rest of the formula remains identical: =A2/86400+25569. Ensure your input data is actually in seconds, as mixing units will produce incorrect results.

How do I remove the time portion and keep only the date?

You can use the INT function to truncate the decimal part of the serial number, which represents the time. Apply the formula =INT(A2/86400000+25569) and format the cell as a short date. This effectively strips the hours, minutes, and seconds, leaving only the calendar date.

Does this method work for negative timestamps?

Negative timestamps represent dates before January 1, 1970. The formula works correctly for these values as well, producing dates prior to 1970. However, be aware that very early dates might exceed the limits of some legacy date systems or display incorrectly in older software versions.

What if my timestamp includes microseconds?

If your timestamp has more precision than milliseconds, such as nanoseconds or microseconds, you must adjust the divisor accordingly. For microseconds, divide by 86,400,000,000. For nanoseconds, divide by 86,400,000,000,000. The epoch offset remains the same regardless of the sub-second precision.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More