Page 1 of 1

Date and time

PostPosted: Fri Apr 16, 2010 2:24 pm
by MarcoBoschi
Hi,
I have to obtain Date and Time, but I have only the date...see below.
Which property have I to use for time?
Thanks

LOCAL oOutlook := TOleAuto():New( "Outlook.Application" )
LOCAL oNameSpace := oOutlook:getnamespace('MAPI')
LOCAL oFolder := oNameSpace:GetDefaultFolder( 5 )
LOCAL nItems
LOCAL oMail
LOCAL iMsg
LOCAL cNomeMsg

nItems := oFolder:Items:Count
oMeter:nTotal := nItems

FOR iMsg := 1 TO nItems

oMail := oFolder:Items[ iMsg ]

? oMail:Subject // Test email
? omail:SentOn // 16/04/2010
? oMail:CreationTime // 16/04/2010
? oMail:ReceivedTime // 16/04/2010

NEXT iMsg

Re: Date and time

PostPosted: Fri Apr 16, 2010 2:35 pm
by anserkk
Dear Mr.Marco

What is the the value returned when you try the ValType

? ValType( oMail:CreationTime) // Is it T or D
? ValType(oMail:ReceivedTime) // Is it T or D

Regards
Anser

Re: Date and time

PostPosted: Fri Apr 16, 2010 2:47 pm
by MarcoBoschi
Anser
always "D"
I use Outlook 2000
Thankyou

Re: Date and time

PostPosted: Fri Apr 16, 2010 3:21 pm
by MarcoBoschi
Ok
I found here something useful!

http://groups.google.com/group/comp.lan ... 45c125e167

Have a nice weekend
Thans

Re: Date and time

PostPosted: Fri Apr 16, 2010 3:39 pm
by nageswaragunupudi
oMail:CreationTime and oMail:ReceivedTime are both DateTime values. xHarbour shows valtype of both simple dates as well as DateTime values as 'D' only, while Harbour shows ValType of DateTime values as 'T' and simple dates as 'D'.

In xHarbour HB_IsDateTime( d ) returns .t. if the variable contains Timepart also and .f. if the variable is a simple date only. However in some earlier versions of xHarbour there was a bug and HB_IsDateTime( d ) was returning .t. for both simple dates and datetime variables.

With latest xHarbour and FWH, ? oMail:CreationTime shows both date and time part. If we are using earlier version of xHarbour, we can use TTOC( oMail:CreationTime ) to see both Date and Time formatted.

Re: Date and time

PostPosted: Sun Apr 18, 2010 8:00 am
by MarcoBoschi
Ok very interesting
Bye