FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Date and time
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
Date and time
Posted: Fri Apr 16, 2010 02:24 PM
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: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
Marco Boschi
info@marcoboschi.it
Posts: 1335
Joined: Fri Jun 13, 2008 11:04 AM
Re: Date and time
Posted: Fri Apr 16, 2010 02:35 PM

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

Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
Re: Date and time
Posted: Fri Apr 16, 2010 02:47 PM

Anser
always "D"
I use Outlook 2000
Thankyou

Marco Boschi
info@marcoboschi.it
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
Re: Date and time
Posted: Fri Apr 16, 2010 03:21 PM

Ok
I found here something useful!

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

Have a nice weekend
Thans

Marco Boschi
info@marcoboschi.it
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Date and time
Posted: Fri Apr 16, 2010 03:39 PM

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.

Regards



G. N. Rao.

Hyderabad, India
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
Re: Date and time
Posted: Sun Apr 18, 2010 08:00 AM

Ok very interesting
Bye

Marco Boschi
info@marcoboschi.it

Continue the discussion