且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何将以下转换为天数小时和分钟

更新时间:2023-12-02 16:23:40

假设单元格包含DateTime值:

Assuming the cells contain DateTime values:
Dim diff as TimeSpan = row.Cells("Current_date").Value - row.Cells("Allocated_Date").Value
row.Cells("Pendingsince").Value = String.Format("{0} days {1} hours and {0] minutes", diff.Days, diff.Hours, diff.Minutes)