操作方法
In ArcGIS Pro, decimal time can be converted to hours, minutes, and seconds using the Convert Time Field tool and the Calculate Field tool. However, in some instances, the result of the Convert Time Field tool represents a point of time and is stored in a date field as datetime yyyy-mm-dd hh:mm:ss AM or PM. This article provides the workflow to convert decimal time to a duration of time represented in hours, minutes, and seconds using the Calculate Field tool. The result of this workflow is stored in a text field.
str(int(!Field Name!))+"h "+str(round((!Field Name!*60) % 60))+"m "+str(round((!Field Name!*3600)% 60))+"s"
Note: Do not remove the exclamation marks surrounding the field name. Custom texts or spacing can be replaced in the double quotation marks (" ") if required.
The output is populated in the new text field in a custom format of hours, minutes, and seconds.
获取来自 ArcGIS 专家的帮助
下载 Esri 支持应用程序