You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Numbers 12 does not recognise custom date format for timestamp

Hi all.


I need to import a CSV file in Numbers. This file contains a column with ISO-8601 timestamp formatted as "yyyy-mm-dd'T'hh:mm:ss.SSSZ". So for example One entry can be like: 2022-06-05T17:32:49.380Z


I tried to define a cutom date & time format for this column as I need to do calculations on those dates; but I cannot manage to get Numbers recognize this custom format.


Here is the screenshot of my custom format:


What am I doing wrong ? Why this is not correctly interpreted ?



MacBook Pro 15″, macOS 10.14

Posted on Jun 10, 2022 1:58 AM

Reply
2 replies

Jun 10, 2022 9:57 AM in response to JosefV

Yes, because Custom Data Format can control how a date-time can be displayed, but it can't effect the actual value in the cell.


So you need to convert the ISO-8601 to a format Number recognizes, such as yyyy-mm-dd hh:mm:ss.


If you just need the Date and don't care about the Time then this will convert a value in B2.


=TEXTBEFORE(B2,"T")+0


If you need the Time as well then you can try this:


=(TEXTBEFORE(B2,"T")&" "&TEXTBETWEEN(B2,"T","."))+0




The equivalents of these with Language set to French and Region set to France would be:


=TEXTE.AV(B2;"T")+0


and


=(TEXTE.AV(B2;"T")&" "&TEXTE.ENTRE(B2;"T";"."))+0


You will lose the milliseconds.





You may be wondering about the +0 in the formulas. It's just a trick to force Numbers to treat the result as Date-Time (right-aligned by default) rather than Text. You can then reformat the Numbers if you want in the pane at the right.


Once you have the dates in the proper format in Numbers you can "remove" the formulas by selecting the cells, typing command-c to copy, followed by Edit > Paste Formula Results.


SG



Numbers 12 does not recognise custom date format for timestamp

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.