SSRS 2005在HH:MM:SS中显示持续时间超过24小时的秒数

时间:2011-08-04 19:09:32

标签: vb.net timestamp ssrs-2008 reportingservices-2005 reporting-services

首先,谢谢大家的帮助!!!

我要做的就是获取一些在SSRS 2005中有效的VB.net代码,以34:17:45显示123465。

这是我到目前为止所尝试的:

Public Shared Function secondsToString(seconds As int64) As String
Dim myTS As New TimeSpan(seconds * 10000000)
If seconds > 0 then
  Return String.Format("{0:00}:{1:00}:{2:00}",myTS.Hours, myTS.Minutes, myTS.Seconds)
Else
  Return ""
End if
End Function

你能提供的任何帮助都会很棒!

再次感谢!

2 个答案:

答案 0 :(得分:1)

Public Shared Function secondsToString(seconds As int64) As String
Dim myTS as new TimeSpan(seconds * 10000000)
If seconds > 0 then
  Return String.Format("{0:HH\\:mm\\:ss}",seconds)
Else
  Return ""
End if
End Function

答案 1 :(得分:1)

Public Shared Function secondsToString(seconds As int64) As String
   Dim myTS As New TimeSpan(seconds * 10000000)
   If seconds > 0 then
     Return String.Format("{0:00}:{1:00}",myTS.TotalHours, myTS.Minutes)
   Else
     Return ""
   End if
End Function