Thank you for all your help, but the answer I came up with looks like this:
ToMilliseconds = Function(time, timestring = "")
If time <> invalid
timestamp = time.AsSeconds()
ms = time.GetMilliseconds()
timestampString = timestamp.ToStr() + ms.ToStr()
Else
timestampString = timestring
End If
low = timestampString.Mid(timestampString.Len() - 9, 9).ToInt()
high = timestampString.Mid(0, timestampString.Len() - 9).ToInt()
output# = high
output# = output# * 1000000000
output# = output# + low
return output#
End Function
And then:
time = CreateObject("roDateTime")
timestamp = GetGlobalAA().util.ToMilliseconds(time)
print timestamp
part1 = Int(timestamp / 1000000).toStr().Trim()
coolString = part1 + "000000"
coolTimestamp = GetGlobalAA().util.ToMilliseconds(invalid, coolString)
part2 = Str(timestamp - coolTimestamp).Trim()
print part1
print part2
timeStampString = part1 + part2
print "--------------"
print timeStampString
BTW BrightScript is the best language in the World