测试成功
[Test] public TimeSpan geTimeSpan(int val) { var result = new TimeSpan(); if (val < 60) { var query = new TimeSpan(0, 0, val); result = query; } if (val < 3600) { var m = val/60; var s = val%60; var query = new TimeSpan(0,m,s); result = query; } else { var h = val/3600; var m = val / 60; var s = val % 60; var query = new TimeSpan(h, m, s); result = query; } return result; }
时间: 2024-10-21 00:55:13