| | |
| | | return StringUtility.Contact(hours.ToString("D2"), ":", mins.ToString("D2"), ":", seconds.ToString("D2")); |
| | | } |
| | | |
| | | //极简显示 |
| | | // x天x小时 |
| | | // x小时x分 |
| | | // x分 |
| | | // x秒 |
| | | public static string SecondsToShortDHMS(int _seconds) |
| | | { |
| | | int days = _seconds / 86400; |
| | | int hours = _seconds % 86400 / 3600; |
| | | int mins = _seconds % 3600 / 60; |
| | | int seconds = _seconds % 60; |
| | | if (days > 0) |
| | | { |
| | | return StringUtility.Contact(days, Language.Get("L1074"), hours, Language.Get("L1072")); |
| | | } |
| | | else if (hours > 0) |
| | | { |
| | | return StringUtility.Contact(hours, Language.Get("L1072"), mins, Language.Get("L1073")); |
| | | } |
| | | else if (mins > 0) |
| | | { |
| | | return StringUtility.Contact(mins, Language.Get("L1073")); |
| | | } |
| | | return StringUtility.Contact(seconds, Language.Get("L1075")); |
| | | } |
| | | |
| | | |
| | | |
| | | //例子 |
| | | //大于24小时显示:x天xx小时xx分 |
| | | //小于24小时显示:xx:xx:xx |