跳到主要内容

在 Excel 中处理日期时间数据时,您可能会遇到诸如“1/24/2024 14:30:00”之类的日期时间值,并且您可能需要仅提取日期“1/24/2024”而不包含时间部分。本文将向您介绍四种从时间戳中删除时间的简单方法。这些方法简单易懂,适用于各种情况,无论您是初学者还是经验丰富的 Excel 用户,都可以快速学习和应用。

通过更改格式隐藏日期中的时间

使用智能功能从日期中删除时间

使用公式从日期中删除时间

使用查找和替换功能从日期中删除时间


通过更改格式隐藏日期中的时间

  1. 选择要删除时间的单元格,然后右键单击,在上下文菜单中选择 单元格格式 打开 单元格格式 对话框。 看截图:
    Tips:: 也可以使用快捷方式 Ctrl+1 打开 单元格格式 对话框。

  2. 单元格格式 对话框,在“数字”选项卡下:
    1)。 选择 日期 来自 产品分类 清单
    2)。根据需要从日期类型中选择一种 Type 列表框;
    3)。最后,点击 OK 按钮。
  3. 现在,所选单元格的格式设置为仅显示日期,并删除了时间。看截图:
备注:此方法只是隐藏了时间部分,并没有真正将其删除,日期和时间仍然可以在公式栏中看到。此外,如果在任何计算中使用这些单元格,则这些值将包括日期和时间。

使用智能功能从日期中删除时间

如果你想从时间戳中完全删除时间, Kutools for Excel 提供了一个智能功能—— 从日期中删除时间,使用此功能,您只需单击几下即可直接从日期时间单元格中删除时间。

备注: 如果你想用这个 从日期中删除时间 功能,请 下载并安装 Kutools for Excel 第一。

安装后 Kutools for Excel,请这样做:

  1. 单击以选择要放置结果的单元格,然后单击 库工具 > 公式助手 > 公式助手.
  2. 公式助手 对话框中,单击 从日期中删除时间 ,在 选择一个公式 部分。
  3. 然后去看看 参数输入 部分,选择要从中删除时间的单元格。
  4. 最后点击 OK 按钮。

结果:

现在,时间已从日期时间中删除,然后将填充手柄拖动到要根据需要应用此公式的单元格上,请参阅下面的演示:

提示: 要应用此功能,请 下载并安装 Kutools for Excel 第一。

使用公式从日期中删除时间

在 Excel 中,有一些简单的公式可用于消除时间戳中的时间,从而允许您仅提取日期部分。

使用 INT 函数仅提取日期

  1. 请将以下公式输入或复制到要放置结果的单元格中。然后,向下拖动填充手柄将此公式填充到其余单元格中,您将在结果中得到带有时间部分的日期(00:00:00),请参见屏幕截图:
    =INT(A2)
  2. 要不显示时间部分,仍保持结果选择,然后单击 主页 > 总类 > 短期约会。现在,结果仅显示为日期。看截图:

使用 DATE 函数仅提取日期

要仅提取日期部分,您还可以使用 DATE 函数。

通用语法:

=日期(年(日期时间),月(日期时间),日(日期时间))
日期时间:该单元格包含您仅要提取日期的日期时间。

请将以下公式输入或复制到要放置结果的单元格中。然后,向下拖动填充柄以将此公式填充到其余单元格中,所有日期均已从没有时间的日期时间单元格中提取。看截图:

=DATE(YEAR(A2),MONTH(A2),DAY(A2))


使用查找和替换功能从日期中删除时间

请按照以下步骤使用 Excel 从日期中删除时间 查找和替换 功能:

  1. 选择您要删除时间的日期范围。
  2. 媒体 Ctrl + H 或导航到 主页 > 查找和选择 > 更换 打开 查找和替换 对话框。
  3. 查找和替换 对话框:
    1).进入 空格键和星号 *查找内容 框;
    2)。 留着空白 ,在 更换 框;
    3)。最后,点击 “全部替换” 按钮。
  4. 现在,所有时间均已从日期范围中删除,日期可能仍会显示时间部分 00:00:00。看截图:
  5. 然后,您可以通过单击设置范围格式以仅显示日期 主页 > 总类 > 短期约会。 看截图:
Tips::使用 查找和替换 非常棒,因为您可以在数据所在的同一单元格中直接更改数据,而无需额外的列。请记住制作备份副本,以防您以后再次需要原始数据。这样,您就可以保持物品整洁和安全!

相关文章:

  • 在Excel中从日期时间中删除日期
  • 如果您的工作表中有日期和时间戳的列表,现在您想从日期时间中删除日期,只保留时间。 您有快速的方法来处理这项工作吗?
  • 将文本和日期合并到Excel中的同一单元格中
  • 假设您有两列,其中一列包含文本字符串,另一列填充了日期,现在,您想将这两列组合以获得以下屏幕快照结果。 我们大多数人可能直接将两列连接起来,但是日期将显示为整数。 本文,我将介绍一些有效的方法来将文本和日期正确组合到Excel中的一个单元格中。
Comments (32)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Just copy the columns and paste them in a txt file, the txt file will not show the hours and minutes. Copy the dates from the txt and paste it back to the xls file. pretty easy
This comment was minimized by the moderator on the site
Copy to a cell and format as general (MS Date Value), then ROUNDDOWN,0 Simple.
This comment was minimized by the moderator on the site
what i've noticed is that when you clean the "date" column, you will always get a standard Number comprised of 5 digits. Usually it something like 43xxx. If the cell contains a timestamp ( 09:40:33) , your number will be 43xxx.yyy, where .yyy contains the details of the Hours:minutes:seconds. What always works a treat for me is to eliminate what's after the "." . To do this, I simply use =left(clean(A1),5) , whereby A1 = cell with the date stamp :) hope this helps anyone.
This comment was minimized by the moderator on the site
This was so helpful and worked for my needs exactly! Thank you!
This comment was minimized by the moderator on the site
Thanks a lot! For me it worked. Is funny you can found better solutions in the comments section than in the actual post ;)
This comment was minimized by the moderator on the site
useful, thanks
This comment was minimized by the moderator on the site
thank you !!!
This comment was minimized by the moderator on the site
cara show de bola
muitissimo obrigado
This comment was minimized by the moderator on the site
Thanks you so much , for that replace option work,,thank you
This comment was minimized by the moderator on the site
Thank you! This helped me a great deal to make dates so that I can then create charts showing accurate trends in performance.
This comment was minimized by the moderator on the site
just use formula =int(date)
This comment was minimized by the moderator on the site
dropping the time with a global replace - GENIUS, dude (...or dudette).
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations