It fails because not everyone uses US regional settings: For me GetVarDate returns data in format "yyyy.MM.dd. HH:mm:ss" Therefore there is no T1(2) - either way you should build you date string from seperate parts, not split unknown format. Like: GetVarDate is ok for output, but to compare values, build it from parts. Anyhow this will return value as "yyyy.MM.dd. HH:mm:ss" no matter what settings are configured. dt.Year & "." & Right("00" & dt.Month, 2) & "." & Right("00" & dt.Day, 2) & ". " & _ Right("00" & dt.Hours, 2) & ":" & Right("00" & dt.Minutes, 2) & _ ":" & Right("00" & dt.Seconds, 2) Uptime function - minor modification by me, not sure what was original: Function TimeSpan(dt1, dt2) Dim seconds, minutes, hours, days If (isDate(dt1) And IsDate(dt2)) = False Then TimeSpan = "" Exit Function End If seconds = Abs(DateDiff("S", dt1, dt2)) minutes = seconds \ 60 hours = minutes \ 60 days = hours \ 24 hours = hours mod 24 minutes = minutes mod 60 seconds = seconds mod 60 TimeSpan = days & " days " & _ Right("00" & hours, 2) & "h " & _ Right("00" & minutes, 2) & "m " & _ Right("00" & seconds, 2) & "s" End Function