Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
BUG: int() returning wrong values from datetime operatio
Message
From
01/11/2005 13:09:42
 
 
To
01/11/2005 13:02:49
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2000 Server
Miscellaneous
Thread ID:
01058678
Message ID:
01064121
Views:
50
>>
>>Never prints anything besides "000" for me.
>>
FOR x=1 TO 10
>>  INKEY(0.001)
>>  ?ttocEXT(DATETIME())
>>ENDFOR
>
>
>If you make a new pot you have to redo the lid.
>
>
>? ttocExt(DatetimeExt())
>
>FUNCTION DatetimeExt
>	RETURN DATETIME()+VAL(RIGHT(TIME(1),2))*0.01
>	
>function ttocExt
>* ttoc replacement to include milliseconds
>LPARAMETERS ptDateTime
>lnMilli=ROUND((ptDateTime-DATETIME(YEAR(ptDateTime),MONTH(ptDateTime),DAY(ptDateTime),hour(ptDateTime),MINUTE(ptDateTime),SEC(ptDateTime)))*1000,0)
>IF lnMilli<0
> ptDatetime = ptDatetime + 1
> lnMilli=lnMilli+1000
>ENDIF
>RETURN TTOC(ptDateTime)+'.'+PADL(lnMilli,3,'0')
>
>
Sounds reasonable to me. But I thought that DATETIME() did return a millisecond value, you just didn't see it, and that's what would cause problems in trying to do a SELECT for a specific datetime type value.
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform