The easiest way to remove time from a date in Excel is to change the number format.
This does not remove the time from the timestamp - it just prevents it from displaying in your cell. If you use these cells in calculations, the time and date are still included.
To change the date format in Excel using number format:
After you change the format, the time will stop appearing in your cells.
If you click on one of the cells, the time format is still visible in the formula bar.
The above method only gives you two time/date options to choose from. If you want more control over how your data is displayed, you'll want to use the "Set CellFormat" method.
To change the date format in Excel using advanced cell formatting:
The date is now displayed without the time, but if you click the cell, the time is still displayed in the formula bar.
To completely remove time information, you can use the INT function. That's because timestamps are in decimal form. The number before the decimal point represents the date, and the number after the decimal point represents the time.
INT function deletes everything after the decimal point, removes time information but retains date information.
To remove time from a date using INT in Excel:
Your results will now show a time of 12:00 AM. This is because the cell is still Takes a format that displays the date and time. Since the time portion is now zero, it displays it as 12:00 AM.
To completely remove the time, follow the previous section Follow the steps in to change the date format to one that does not include the time.
Knowing how to remove time from a date in Excel can allow you to display exactly what you want of data.
You can provide more detailed date information by adding the month in Excel. If your timestamp displays as text, you can also convert the text to a date. In Excel, you can Cut text to remove unnecessary parts.
The above is the detailed content of How to remove time from date in Excel. For more information, please follow other related articles on the PHP Chinese website!