09-29-2009, 07:05 AM
I have this function...
I would like to use it as a member function for a string variable so I can call it like:
str Length.GetDateTime("800.32")
or better yet...
A member function of DateTime...
str Length="800.32"
DateTime x.SecondsToDateTime(Length)
Thanks,
Jimmy Vig
str sLength="800.32"
ARRAY(str) arr
int i nt
nt = tok(sLength arr 2 ".")
str MS.from("." arr[1])
err
,MS.from(".")
double iMS=val(MS 2);err
MS.format("%.03f" iMS)
MS.remove(0 1)
int Length=val(sLength 2)
if Length>86400
,ret
int Hours=Length/3600
int Minutes=(Length-(Hours*3600))/60
int Seconds=(Length-(Hours*3600)-(Minutes*60))
str HMS.from(Hours ":" Minutes ":" Seconds MS)
DateTime x
x.FromStr(HMS)
sLength=x.ToStrFormat("{HH}:{mm}:{ss}.{F}")
out sLength
I would like to use it as a member function for a string variable so I can call it like:
str Length.GetDateTime("800.32")
or better yet...
A member function of DateTime...
str Length="800.32"
DateTime x.SecondsToDateTime(Length)
Thanks,
Jimmy Vig