I do not want to rewrite the VB6 application, the double returned from Now() has other data inserted at the decimal point. On the receiving end the PHP will extract this data, reinsert the decimal point and check for the date.
In the previous post I stated that Microsoft technlogy in VB/VBA/VBscript uses an internal function Now() to produce the current Date/Time.
The current Date/Time is not what I want, what I want is the current Date/Time at the point the VB application output its data. It is not important for you to know the inner workings of what I am doing, only to offer advice (if you wish to) on how to convert the double into the exact date that left the VB application into MySql.
No code on this particular item has been written, I was investigating how to store the double in the MySql database to give the desired date/time result.
Basically I am rewriting an IIS/ASP/VB DLL/MS SQLserver web site to WAMP. This item has now become a minor problem as faced with the huge differences between retrieving and maniplating data with these two technologies. What one takes for grated as an easy task in the technology you are familiar with can seem like an insurmountable problem when using another. As I stated previously I do not wish to rewrite the VB Application which functions correctly, I shall probably use a workaround on this as it seems to be dragging on, and there are a myriad of other problems to learn and hopefully solve.
It looks to me like the “double” is in OLE Automation date format, where the integer part is the number of days since the base date (midnight Dec 30 1899) and the fractional part the fraction of the day (e.g. 6 am is .25).
You are correct in the fact that the double gives a date/time, this was fully explained in an earlier post, however, all answers I have received thus far are completly missing the point which is that the date/time ‘double’ is created elsewhere in the VB application. When received by the website I do not want to alter this date/time in any way, but I do wish to store it in a MySql database. So what I am looking for is either a PHP or MySql function that will convert this ‘double’ into a date/time which has not changed or altered it in any way.
The description in my previous post laid out the steps you could go through inside a function to go from a “double” represented date/time, to a format that MySQL would be happy to accept – just not laid out in code. There is no single, direct equivalent to cdate() or DateTime.FromOADate() in PHP so you’ll want to write a function for it using the DateTime class as I mentioned above.
I have had a rethink on this situation and have reached the conclusion that this data can be stored as a string, and when required (not for PHP or MySql use) the oiginal can be reconstituted by insertng a decimal point at position 6 in the string which will give me the desired result.
Thanks for your interest and help on this problem.