Date and time

Date and time

Postby MarcoBoschi » Fri Apr 16, 2010 2: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: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
User avatar
MarcoBoschi
 
Posts: 1025
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: Date and time

Postby anserkk » Fri Apr 16, 2010 2: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
User avatar
anserkk
 
Posts: 1331
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: Date and time

Postby MarcoBoschi » Fri Apr 16, 2010 2:47 pm

Anser
always "D"
I use Outlook 2000
Thankyou
User avatar
MarcoBoschi
 
Posts: 1025
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: Date and time

Postby MarcoBoschi » Fri Apr 16, 2010 3:21 pm

Ok
I found here something useful!

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

Have a nice weekend
Thans
User avatar
MarcoBoschi
 
Posts: 1025
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: Date and time

Postby nageswaragunupudi » Fri Apr 16, 2010 3: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
User avatar
nageswaragunupudi
 
Posts: 10308
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Date and time

Postby MarcoBoschi » Sun Apr 18, 2010 8:00 am

Ok very interesting
Bye
User avatar
MarcoBoschi
 
Posts: 1025
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 35 guests