Skip to main content
Dominique Sacre
Rocketeer
Feb 15, 2013 10:40 PM UTC

How can I pass a date and time to the FormatDateToOLE method?

Problem:

The Micro Focus FormatDateToOLE method only accepts a date (day, month, year) as a parameter and not time time.  How can I convert my date and time in to an OLE format?

Resolution:

As you have found, our own method (FormatDateToOLE) only accepts the date i.e. no time.  However, this COBOL method simply calls the Windows VarDateFromStr() API.

You can find out information on this API at:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/automat/html/a5c21ceb-ed8b-4a95-8957-e9d7fc5bd90e.asp

You may also want to read the following Microsoft KB article:

http://support.microsoft.com/kb/291075

Old KB# 3808