/* If there are zero parameters (if even argv is undefined) then assume a default value of "now" for argv.  */
static int isDate(sqlite3_context *context, int argc, sqlite3_value **argv, DateTime *p)
/* If there are zero parameters (if even argv is undefined) then assume a default value of "now" for argv.  */
static int isDate(sqlite3_context *context, int argc, sqlite3_value **argv, DateTime *p)
{
  int i;
  const unsigned char *z;
  int eType;
  memset(p, 0, sizeof(*p));
  if( argc==0 ){
    return setDateTimeToCurrent(context, p);
  }
  if( (eType = sqlite3_value_type(argv[0]))==SQLITE_FLOAT
                   || eType==SQLITE_INTEGER ){
    p->iJD = (sqlite3_int64)(sqlite3_value_double(argv[0])*86400000.0 + 0.5);
    p->validJD = 1;
  }else{
    z = sqlite3_value_text(argv[0]);
    if( !z || parseDateOrTime(context, (char*)z, p) ){
      return 1;
    }
  }
  for(i=1; i<argc; i++){
    z = sqlite3_value_text(argv[i]);
    if( z==0 || parseModifier(context, (char*)z, p) ) return 1;
  }
  return 0;
}