Posted by Bob Acker on September 14, 2009 at 07:25:23: Uploaded files: 1
Was working on a IB/MTB program to convert the COMET Date/Time to the Microsoft Format (sequential day since 1899-12-30.fraction of a day)
Anyway, tried this two ways when converting the milliseconds since midnight to a fraction of a day, once using the SET compiler directive and once using the literal... when I ran it, the literal gave the right number (fraction), but the division by the SET gave .00000000.... anything glaring that I'm missing?
was thinking sizes of results, but needed at least 8 decimals... and, since the sequential days (microsoft serial day) is now roughtly 40,000 #####.######## (13.8 should suffice).
was wondering if, since 86400000.00000000 is really 16.8, does this affect the required sizes of the final result?
Thanking you all in advance!
Bob "A"
	SET CONSOLE=0
	SET MSECSPERDAY = 86400000.00000000
!
	LENGTH	 16		&	LOCAL	MSDDATETIME$
	LENGTH	 14.8	&	LOCAL	MSDDATETIME
	LENGTH	 16		&	LOCAL	MSDDATETIMELIT$
	LENGTH	 14.8	&	LOCAL	MSDDATETIMELIT
	LENGTH	  8.0	&	LOCAL	MSDMSECS ! MilliSeconds since Midnight
!
	MSDMSECS = 31313033
!
	MSDDATETIME = MSDMSECS / MSECSPERDAY
	MSDDATETIME$ = STR(MSDDATETIME)
!
	MSDDATETIMELIT = MSDMSECS / 86400000.00000000
	MSDDATETIMELIT$ = STR(MSDDATETIMELIT)
!
	PRINT (CONSOLE) (ET)
	PRINT (CONSOLE) "Milliseconds since midnight....:"
	PRINT (CONSOLE) MSDMSECS
	PRINT (CONSOLE) "Microsoft Date + Time.(Literal):"
	PRINT (CONSOLE) MSDDATETIMELIT
	PRINT (CONSOLE) "Microsoft Date + Time.(SET)....:"
	PRINT (CONSOLE) MSDDATETIME
	WAIT
!
!***  Exit  ***
	IF ENTERLEVEL GT 0 EXIT
	RUN "QMONITOR"        	
Each file can be a maximum of 1MB in length Uploaded files will be purged from the server on a regular basis.