I think StartTime and EndTime in the OnTimeRangeChange event is the UTCSeconds from 1-Jan-1970. Instead of casting to a Date, you can add reference to PITimeServer type library and assign UTCSeconds of a PITime object as StartTime (or EndTime) and use PITime.LocalDate property to get the local time.
A sample code snippet will be like this:
Private Sub PITrend1_Sheet1_OnTimeRangeChange(ByVal Source As PBWebClient.pbwTimeRangeChangeSourceEnum, ByVal Temporary As Boolean, ByVal StartTime As Variant, ByVal EndTime As Variant, ByVal TimeZoneInfo As Variant)
Dim st As PITime
Dim et As PITime
Set st = New PITime
Set et = New PITime
st.UTCSeconds = StartTime
et.UTCSeconds = EndTime
Sheet1.Cells(1, 1) = st.LocalDate
Sheet1.Cells(2, 1) = et.LocalDate
Hope this helps.
Han Yong is right on that the number you get in the variant parameters are numbers of second since 01-Jan-1970 UTC.
However, I would recommend another approach to convert these back to actual dates, without making use of the PITimeServer library:
Dim st, et As Double
st = CDbl(StartTime)
et = CDbl(EndTime)
Sheet1.Cells(1, 1) = DateAdd("s", st, "1-jan-70")
Sheet1.Cells(1, 2) = DateAdd("s", et, "1-jan-70")
Actually, if you use my approach you will have to manually handle time zone conversion (since you get a UTC time back). This is something that the PITime objects handles for you, when you ask for .LocalDate.
Might be safer to use PITime in the end... it's up to you