Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
hundredths of a second
#1
Is there a way to use s.time and get hundredths of a second? Or is there another way to do it?
#2
str.time cannot format part of second. Use GetTickCount, timeGetTime, GetLocalTime or some other Windows API function. Example:

Code:
Copy      Help
SYSTEMTIME st
GetLocalTime &st
out "%02i:%02i:%02i.%02i" st.wHour st.wMinute st.wSecond st.wMilliseconds/10
#3
How can i set the system time from a str thats "10:11:00"? I have so far
ARRAY(str) b
SYSTEMTIME st
st.wHour=val(b[1])
st.wMinute=val(b[2])
st.wSecond=val(b[3])
st.wMilliseconds=0
SetLocalTime &st
GetLocalTime &st

However, this does nothing to my clock. Nothing is changed. Is my code bad or is windows xp sp2 with mcafee blocking something?
#4
Use function Time.

Example 1
Code:
Copy      Help
str st="20:50:00"
ARRAY(str) b
tok st b -1 ":"
Time val(b[0]) val(b[1]) val(b[2])

Example 2
Code:
Copy      Help
str st="19:49:00"
DATE d=st
SYSTEMTIME t
d.tosystemtime(t)
Time t.wHour t.wMinute t.wSecond


Forum Jump:


Users browsing this thread: 1 Guest(s)