/* The following are acceptable forms for the input string:  */
static int parseDateOrTime(sqlite3_context *context, const char *zDate, DateTime *p)
/* The following are acceptable forms for the input string:  */
static int parseDateOrTime(sqlite3_context *context, const char *zDate, DateTime *p)
{
  double r;
  if( parseYyyyMmDd(zDate,p)==0 ){
    return 0;
  }else if( parseHhMmSs(zDate, p)==0 ){
    return 0;
  }else if( sqlite3StrICmp(zDate,"now")==0){
    return setDateTimeToCurrent(context, p);
  }else if( sqlite3AtoF(zDate, &r, sqlite3Strlen30(zDate), SQLITE_UTF8) ){
    p->iJD = (sqlite3_int64)(r*86400000.0 + 0.5);
    p->validJD = 1;
    return 0;
  }
  return 1;
}