How to Differentiate an item is of type DATE or TIME?

To find out an item is of type DATE or TIME, i wrote the below code:

Dim doc as Notesdocument

Dim item as NotesItem

Dim val0, isDate%, isTime%

'Set the document object

Set doc = …

'Set item

Set item = …

If Item.Type = 1024 then 'Item is of type : DATETIMES

val0 = Item.Values(0)

If cbl(val0) >= 1 then

isDate% = True

else

isTime% = True

end if

end if

As per my knowledge, cdbl converts the Date value to a number greater than or equal to 1, where as it converts the Time value to a number either 0 or a number with fractional part (which always less than 1).

Just i want to know whether my calculatin is right or not.

If some one has other way to find out whether an item is of type DATE or TIME, please let me know.

Thanks

Adibabu Kancharla

Subject: How to Differentiate an item is of type DATE or TIME?

Date/Time is a number. Date is the integer, time is the mantissa. It has nothing to do with 1.

Subject: RE: How to Differentiate an item is of type DATE or TIME?

I think you’re wrong. If you choose 12.00 AM as a time value and convert it using cdbl, it’ll return 0 which is an integer.

Adibabu

Subject: RE: How to Differentiate an item is of type DATE or TIME?

12:00 AM is a special case, since the mantissa is 0. Try a different time.

Subject: RE: How to Differentiate an item is of type DATE or TIME?

Subject: RE: How to Differentiate an item is of type DATE or TIME?

that’s what mantissa means - the decimal part of a complex number.

Main Entry: man·tis·sa

Pronunciation: \man-ˈti-sə\

Function: noun

Etymology: Latin mantisa, mantissa makeweight, from Etruscan

Date: 1846

: the part of a logarithm to the right of the decimal point

Subject: RE: How to Differentiate an item is of type DATE or TIME?

Nope, has nothing to do with complex numbers (apart from, that the real and imaginary part of a complex number have one).

Subject: RE: How to Differentiate an item is of type DATE or TIME?

Subject: SOLUTION - How to Differentiate an item is of type DATE or TIME?

Dim doc as NotesdocumentDim item as NotesItem

Dim val0, isDate%, isTime%

'Set the document object

Set doc = …

'Set item

Set item = …

If Item.Type = 1024 then 'Item is of type : DATETIMES

If Fix(Item.Values(0)) = Item.DateTimeValue.DateOnly Then

isDate% = True

else

isTime% = True

End IF

end if

Hope It’ll help some one, who needed it.

Thanks

Adibabu Kancharla

Subject: -

Subject: How to Differentiate an item is of type DATE or TIME?