[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference abbott::visual_basic

Title:Microsoft Visual Basic
Moderator:TAMARA::DFEDOR::fedor
Created:Thu May 02 1991
Last Modified:Thu Jun 05 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:2565
Total number of notes:10453

2550.0. "Format$(): Allows julian date calculations ??" by CHEFS::geyzuh.reo.dec.com::Steve_Marshall () Tue May 06 1997 11:03

Folks,

	A question on the functionality of the Format$() function within
	VB. I (totally by mistake) entered a statement 

		?Format$("06/05/1997")

	into the debug window whilst debugging a section of my code. The
	result was a number 35556, which appears to be a Julian 'type'
	date based on 30-Dec-1899.
	
	If I do a ?Format$("30-Dec-1899") I get 0, and this seems to
	increment sequeentially as you move through the dates. If I do
	the reverse of my initial typo:

		?Format$(35556, "dd-mmm-yyyy")

	I get back the correct date of "06-May-1997".

	If you specify an invalid date, for example 29-Feb-1900, then you
	just get the string back unchanged.

	I have checked the documentation (online help) for the function 
	and this capability does not appear to be documented.

	Is this truly an undocumented feature of Format$() allowing the
	quick and easy calculation of julian dates ???


		Steve


T.RTitleUserPersonal
Name
DateLines
2550.1Capability remains in VB5CHEFS::geyzuh.reo.dec.com::Steve_MarshallTue May 06 1997 11:1712
Further,

	I have just talked to the Visual Basic development team and they
	have confirmed that the functionality is undocumented, and that 
	they didn't even know that it did it. They have also confirmed to
	me that the capability is still in VB5, so there is a little
	security in its use.


		Steve