xHarbour Reference Documentation > Function Reference |
Tests if the value returned by an expression is a DateTime value.
HB_IsDateTime( <expression> ) --> lIsDateTime
The function returns .T. (true) if the value returned by <expression> is a DateTime value, otherwise .F. (false) is returned.
Function HB_IsDateTime() is used to test if a variable contains a DateTime value or if the result of an expression is a DateTime value. The function is the only way to distinguish a DateTime value from a Date value, since Valtype(<expression>) yields "D" for both, Date and DateTime.
See also: | HB_IsArray(), HB_IsBlock(), HB_IsByRef(), HB_IsDate(), HB_IsHash(), HB_IsLogical(), HB_IsMemo(), HB_IsNIL(), HB_IsNull(), HB_IsNumeric(), HB_IsObject(), HB_IsPointer(), HB_IsString(), Type(), Valtype() |
Category: | Debug functions , Logical functions , xHarbour extensions |
Source: | rtl\dateshb.c |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
// The example demonstrates how to ditingush Date from DateTime values PROCEDURE Main LOCAL dDate := DateTime() LOCAL dDateTime := Date() ? dDate // result: 04/27/07 13:21:26.00 ? dDateTime // result: 04/27/07 ? Valtype( dDate ) // result: D ? Valtype( dDateTime ) // result: D ? HB_IsDate( dDate ) // result: .T. ? HB_IsDate( dDateTime ) // result: .T. ? HB_IsDateTime( dDate ) // result: .T. ? HB_IsDateTime( dDateTime ) // result: .F. RETURN
http://www.xHarbour.com