Working with Windows DATE? 
Author Message
 Working with Windows DATE?

Greetings,
I'm doing database work with ADO wrappers from the
 'Microsoft ActiveX Data Objects 2.5 Library' library
I don't understand how to work with the DATE datatype.
I'll need to generate a date in dolphin and compare it
to DATE's from the database.  The DATE class is defined
in the ActiveX Automation package.

A C++ method to set a DATE is:
COleDateTime::SetDateTime
int SetDateTime( int nYear, int nMonth, int nDay, int nHour, int nMin,
int nSec );

Thanks

Sent via Deja.com
http://www.*-*-*.com/



Wed, 25 Jun 2003 05:44:55 GMT  
 Working with Windows DATE?
I've made some progress.
Convert DATE to TimeStamp.
Convert TimeStamp to Variant.

winDate " a DATE(12:00:00 AM, Thursday, June 01, 2000) "
stDate :=  winDate asTimeStamp.
stDate " TimeStamp : 12:00:00 AM, Thursday, June 01, 2000"
varFromStDate := stDate asVariant.
varFromStDate " a VARIANT(date: a DATE(12:00:00 AM, Thursday, June 01,
2000)) "

So I've gone from TimeStamp to Variant.
How do I get from Variant to DATE?


Quote:

> Greetings,
> I'm doing database work with ADO wrappers from the
>  'Microsoft ActiveX Data Objects 2.5 Library' library
> I don't understand how to work with the DATE datatype.
> I'll need to generate a date in dolphin and compare it
> to DATE's from the database.  The DATE class is defined
> in the ActiveX Automation package.

> A C++ method to set a DATE is:
> COleDateTime::SetDateTime
> int SetDateTime( int nYear, int nMonth, int nDay, int nHour, int nMin,
> int nSec );

> Thanks

> Sent via Deja.com
> http://www.deja.com/

Sent via Deja.com
http://www.deja.com/


Wed, 25 Jun 2003 06:43:09 GMT  
 Working with Windows DATE?

I got the round trip working.

tsST := (TimeStamp new) date: (Date fromString: '2/1/2001'); time:
(Time fromString: '09:30').  "9:30:00 AM, Thursday, February 01, 2001"
dateVar := tsST asVariant."a VARIANT(date: a DATE(9:30:00 AM, Thursday,
February 01, 2001))"
winDATE := dateVar date. "a DATE(9:30:00 AM, Thursday, February 01,
2001)"
tsST2 := winDATE asTimeStamp."9:30:00 AM, Thursday, February 01, 2001"

Sent via Deja.com
http://www.deja.com/



Fri, 27 Jun 2003 23:38:25 GMT  
 Working with Windows DATE?
Craig

Quote:

>..
> How do I get from Variant to DATE?

VARIANT>>value extracts the value from a VARIANT and returns an appropriate
type of Smalltalk object.

Thus if you have a VARIANT of type VT_DATE:

    TimeStamp current asVariant value.

Or if you have a VARIANT of another type:

    ('01 January 2000' asVariant changeType: (AXAutomationConstants at:
'VT_DATE')) value

Here a string variant is converted to a DATE (which can then be converted to
another date representation if desired). Incidentally this variant
conversion is the only facility the Win32 system provides to parse a date
string. Why would such a useful capability be buried in the depths of the
automation support we ask?

Regards

Blair



Fri, 27 Jun 2003 23:58:58 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. A custom built DLL crashes labview 5.1 in windows 2000 but worked fine in windows 98

2. Work with date

3. C4 - working with dates

4. Stored procedures with date parameters don't work

5. Investigative Work - VW 2.0 Release date

6. Multi Component Key with Dates don't always work as easy as 1,2,3

7. Number of work days between two dates

8. dATE AND TIME PICKER ACTIVEX NOT WORKING

9. Number of working days between dates.

10. Unix system g77 calls DATE and TIME not working for Alpha/Linux

11. Date Manipulation Does Not work?

12. Working with dates and time in Tcl

 

 
Powered by phpBB® Forum Software