Forum Discussion
Yugan475
Jul 18, 2020Copper Contributor
Date Format
The present Date Format is 2020-06-17T00:00:00.000Z I want it as " YYYY-MM-DD" Please suggest
OwenPrice
Jul 18, 2020Iron Contributor
Suppose your date is in cell A1, use this:
=LEFT(A1,10)
As you can see, this simply takes the first 10 characters from your current timestamp string and Excel properly recognizes it as a date, on which you can use Date-based functions and date arithmetic:
EDIT:
Some useful feedback from SergeiBaklan regarding the above recommendation.
While Excel acting on the above formula and arithmetic will recognize the result as a date, it is not foolproof, so wrap the LEFT function with DATEVALUE to force the result into the correct underlying format. Then format the cell as a date.
=DATEVALUE(LEFT(A1,10))
I prefer DATEVALUE to the -- operator as what's happening is more clear to readers.
manojlambhate
Jul 18, 2020Copper Contributor
Use = TEXT(Your input,"YYYY-MM-DD")