Excel Unix timestamp shows yyyy-44-07 hh:44:01: locale fix
Excel's TEXT() printed yyyy-44-07 hh:44:01 because format codes follow your language. Fix it with local codes, cell formatting or an outside conversion.
TroubleshootingUpdated 6 min read
On this page
You typed =TEXT(E2/86400000+25569;"yyyy-mm-dd hh:mm:ss") and got this instead of a date:
yyyy-44-07 hh:44:01The same formula reportedly worked on a French Mac and in Google Sheets. It failed on a Mac that was described as English.
Why the formula prints yyyy-44-07 hh:44:01
Excel reads the letters in a TEXT format string according to its own language and region settings. People on Microsoft's community Q&A pages say the same: format codes work only with your locale language. A German-language Excel user there found that it expected DDDD where he had always typed the German TTTT, so this goes both ways.
Your output shows which letters were recognized:
yyyyandhhcame out as literal text, so your Excel doesn't useyandhfor year and hour.ddandssbecame07and01, so those letters were recognized.- Both
mmbecame44. A month can't be 44, so Excel read them as minutes. In the fix reported in the original thread,ÅÅÅÅ-MM-DD tt:mm:ss, the month is uppercaseMMand the minutes are lowercasemm. Those letters are from a Nordic-language Excel.
Your formula also uses ; between arguments. That is the separator in many non-English regional settings, so your Excel is probably not running with English region settings, even if macOS menus are in English. I can't tell your exact language from the output alone. To check, open System Settings, search for "Region", and compare it with the language Excel is set to.
The conversion is fine. 86,400,000 is the number of milliseconds in a day, and 25569 is the Excel date number for 1970-01-01. For example, 1719400000123 gives about 45469.463, which is 2024-06-26 11:06:40 UTC.
Step-by-step fixes
Fix 1: Format the cell instead of using TEXT
This avoids typed format codes entirely and works in every language.
- In the result cell, enter
=E2/86400000+25569(use,instead of;if your Excel needs it, though this formula has no separators). - Select the cell or column and press ⌘1 to open Format Cells.
- On the Number tab, choose Date or Time and pick a format from the list.
- If you need date and time together and no listed format has both, choose Custom and type the codes in your Excel's language (see Fix 2).
The cell keeps a real date value, so you can sort it and subtract dates. TEXT returns plain text. One reply on Microsoft's community Q&A gives the same advice: use the plain cell reference with any date format you want on that cell.
Fix 2: Use your language's format codes in TEXT
Use TEXT when you need the date inside a longer string. Write the codes the way your Excel reads them:
| Excel language | Year-month-day hour:minute:second |
|---|---|
| English | yyyy-mm-dd hh:mm:ss |
| Code set from the original thread | ÅÅÅÅ-MM-DD tt:mm:ss |
| Anything else | Copy from Format Cells > Custom |
To find your language's letters, select a cell that shows a date, press ⌘1 and open Custom. The box shows the code behind the current format in your Excel's letters. Copy those letters into your TEXT string and keep the month and minute codes distinct.
Fix 3: Build the text from parts
Number-only formats like "00" contain no year, month or hour letters, so they don't depend on language. With the date number in F2 (=E2/86400000+25569):
=YEAR(F2)&"-"&TEXT(MONTH(F2),"00")&"-"&TEXT(DAY(F2),"00")&" "&TEXT(HOUR(F2),"00")&":"&TEXT(MINUTE(F2),"00")&":"&TEXT(SECOND(F2),"00")Function names and argument separators can be localized too. You may need your language's names for YEAR, MONTH and the rest, and ; instead of ,.
Fix 4: Add a language tag to the format
People on Microsoft's community Q&A report that an LCID code in the format makes TEXT output in a specific language, for example [$-409] for US English at the start of the format string. Treat this as something to try, not a guarantee. It reportedly changes the language of the output, such as month names, and may not change which letters Excel accepts as codes. Test it on one cell before applying it to a column.
Fix 5: Convert outside Excel and paste the result
If you only need readable dates once, skip the formula.
Terminal. The macOS date command takes seconds, so divide the milliseconds by 1000 (this drops the last three digits). It only prints text and changes nothing:
date -u -r $((1719400000123/1000)) +"%Y-%m-%d %H:%M:%S"-r reads a Unix timestamp, -u prints UTC, and the quoted part is the output format. Drop -u for your Mac's local time. This prints 2024-06-26 11:06:40. It handles one value at a time unless you write a loop.
Bytepliers. For a whole column, the Unix Timestamp tool in Bytepliers can do the conversion. It doesn't repair formulas in your sheet. It auto-detects epoch seconds, milliseconds, microseconds and nanoseconds. When you paste several lines it builds a table with Input, Local, ISO 8601 (UTC), Unix and Relative columns, up to 5,000 lines, and you can copy the table as tab-separated values.
- In Excel, copy the column of timestamps.
- In Bytepliers, press ⌘7 to open Unix Timestamp and paste into the input.
- Set Numbers to Unix Milliseconds if you don't want to rely on Auto (Unix).
- Copy the table and paste it into a new sheet.
The Numbers picker also has an Excel Serial Date reading. Paste a value like 45469.463 to check which date your formula's result stands for. Bytepliers is part of MacSuite, with a 7-day free trial. Other methods are in how to convert a Unix timestamp on Mac.
Other reasons the result is still wrong
| Symptom | Cause | Fix |
|---|---|---|
| Excel rejects the formula | Argument separator follows your region | Swap ; and , |
| Date near 1970 or far in the future | Wrong divisor | 13 digits = ms, divide by 86,400,000; 10 digits = seconds, divide by 86,400 |
| Time is off by hours | The formula gives UTC | Add your offset divided by 24, such as +2/24 |
| Dates about 4 years off | Workbook uses the 1904 date system | Use 24107 instead of 25569 |
Cell shows 45469.463 | General number format | Apply a date or time format (Fix 1) |
| Formula errors on the source cell | Timestamp stored as text | Wrap it in VALUE(E2) or convert the column to numbers |
Checklist before you try again
- The cell holds a number, not text.
- You divided by 86,400,000 for milliseconds (13 digits).
- Argument separators match your region (
;or,). - Format letters match your Excel's language, or you used cell formatting.
- The result cell isn't set to a number format that hides the date.
If nothing works
If a built-in date format from Format Cells shows the wrong date for a timestamp you know, format codes are not the cause. Contact Microsoft Support. Include your Excel version, the Mac's language and region settings, the raw cell value, the date you expected and the formula you used.
Subject: Excel TEXT() date format returns literal letters
Excel version: (your version)
macOS language/region: (your settings)
Formula: =TEXT(E2/86400000+25569;"yyyy-mm-dd hh:mm:ss")
Raw value in E2: 1719400000123
Result: yyyy-44-07 hh:44:01
Expected: 2024-06-26 11:06:40 (UTC)
Tried: cell formatting via Format Cells, local-language format codesCommon questions
Why does it work in Google Sheets?
Google Sheets accepts the English format letters regardless of your language. Excel on your Mac reads them in the language of its own settings, so the same string behaves differently.
Is the 25569 offset always right?
It is right for Excel's default 1900 date system, where 25569 is 1970-01-01. Workbooks that use the 1904 date system need 24107.
Can I change Excel's language to fix this?
Often, yes. People report fixing similar problems by changing the language and region settings, but that changes every date and number display in the workbook. Using cell formatting or an outside conversion is less disruptive.
Why does my Mac say English but Excel acts like another language?
Excel can follow a separate language and region setting from the system menus. Check both. A formula with ; separators is a hint that the region is set to one that uses them.