如何在Excel中获取两个日期时间戳之间的小时和分钟差异?

时间:2022-08-03 21:30:47

Suppose I have 2 timestamp dates:

假设我有两个时间戳日期:

  1. 2/24/2010 1:05:15 AM
  2. 2/24/2010 1:05:15我
  3. 2/25/2010 4:05:17 AM
  4. 2/25/2010 4:05:17我

Can anyone please advise what function should I use in Excel to get the difference in hours and minutes?

请问我在Excel中应该使用什么函数来获取小时和分钟的差异?

Thanks.

谢谢。

4 个解决方案

#1


25  

The difference in hours:

小时的差异:

=(A2-A1)*24

The difference in minutes:

分钟的差异:

=(A2-A1)*24*60

The difference in hours and minutes:

小时和分钟的差异:

=TRUNC((A2-A1)*24)      - the hours portion
=MOD((A2-A1)*24*60,60)  - the minutes portion

#2


4  

this is straight simple in excel and no need to do anything except applying the time format to the cell.

这在excel中非常简单,除了将时间格式应用到单元格之外,不需要做任何事情。

two easy steps:

两个简单的步骤:

  1. put the formula: =B2-A2
  2. 把公式:= B2-A2
  3. simply apply the custom format "h:mm" to the cell.
  4. 只需将自定义格式“h:mm”应用到单元格。

#3


1  

Try this : http://office.microsoft.com/en-us/excel/HP100704681033.aspx

试试这个:http://office.microsoft.com/en-us/excel/HP100704681033.aspx

#4


1  

Excel is able to handle date and time arithmetic. It does this by holding the dates and times as decimals. If you key in a date and time in a format that Excel recognises it will (helpfully!) hold the data as a date and time data type. The integer bit is days, and the decimal bit is time. You can use a time cell format to display the time bit in hours minutes seconds etc, or you can convert the decimal to hours, minutes and seconds using 60 in a simple formula

Excel能够处理日期和时间的算术。它以小数形式表示日期和时间。如果你用Excel识别的格式输入日期和时间,它将(非常有用!)将数据作为日期和时间数据类型保存。整数位是天数,小数部分是时间。您可以使用时间单元格式来显示时间位(以小时、分钟、秒等为单位),也可以使用一个简单的公式,将小数点转换为小时、分钟和秒

The text formula works by displaying the answer in a time format.

文本公式以时间格式显示答案。

#1


25  

The difference in hours:

小时的差异:

=(A2-A1)*24

The difference in minutes:

分钟的差异:

=(A2-A1)*24*60

The difference in hours and minutes:

小时和分钟的差异:

=TRUNC((A2-A1)*24)      - the hours portion
=MOD((A2-A1)*24*60,60)  - the minutes portion

#2


4  

this is straight simple in excel and no need to do anything except applying the time format to the cell.

这在excel中非常简单,除了将时间格式应用到单元格之外,不需要做任何事情。

two easy steps:

两个简单的步骤:

  1. put the formula: =B2-A2
  2. 把公式:= B2-A2
  3. simply apply the custom format "h:mm" to the cell.
  4. 只需将自定义格式“h:mm”应用到单元格。

#3


1  

Try this : http://office.microsoft.com/en-us/excel/HP100704681033.aspx

试试这个:http://office.microsoft.com/en-us/excel/HP100704681033.aspx

#4


1  

Excel is able to handle date and time arithmetic. It does this by holding the dates and times as decimals. If you key in a date and time in a format that Excel recognises it will (helpfully!) hold the data as a date and time data type. The integer bit is days, and the decimal bit is time. You can use a time cell format to display the time bit in hours minutes seconds etc, or you can convert the decimal to hours, minutes and seconds using 60 in a simple formula

Excel能够处理日期和时间的算术。它以小数形式表示日期和时间。如果你用Excel识别的格式输入日期和时间,它将(非常有用!)将数据作为日期和时间数据类型保存。整数位是天数,小数部分是时间。您可以使用时间单元格式来显示时间位(以小时、分钟、秒等为单位),也可以使用一个简单的公式,将小数点转换为小时、分钟和秒

The text formula works by displaying the answer in a time format.

文本公式以时间格式显示答案。