>set date british >clear > >***************************** >* Sets start and end datetime >***************************** >m.T_START = ctot("08/01/2005" + " " + "05:15") >m.T_END = ctot("08/01/2005" + " " + "05:20") > >***************************************** >* Find and show the difference in seconds >***************************************** >m.DIFF_SECONDS = m.T_END - m.T_START >? m.DIFF_SECONDS && Prints 300 > >***************************************** >* Find and show the difference in minutes >***************************************** >m.DIFF_MINUTES = (m.DIFF_SECONDS / 60) >? m.DIFF_MINUTES && Prints 5,0000 > >********************************************************** >* Now the weird thing. Shows the integer of m.DIFF_SECONDS >********************************************************** >? int(m.DIFF_MINUTES) && Prints 4 (Should be 5, not 4!!!) >the datetime on VFP is unusable to make algebra,
clear T_START = {^2005/01/08 05:15:00} T_END = {^2005/01/08 05:15:01} DIFF_SECONDS = m.T_END - m.T_START ? m.DIFF_SECONDS*1.00000000000000000 && don't Print 1 T_START1 = T_START * INCREMENT T_START 10 days FOR K=1 TO 864000 T_START1 = T_START1 + 1 && 1 seconds NEXT DIFF_SECONDS1 = m.T_START1 - m.T_START ? ROUND(m.DIFF_SECONDS1,0) && Print 863995, you have lost 5 seconds!