亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? date.c

?? Trolltech公司發布的基于C++圖形開發環境
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*** 2003 October 31**** The author disclaims copyright to this source code.  In place of** a legal notice, here is a blessing:****    May you do good and not evil.**    May you find forgiveness for yourself and forgive others.**    May you share freely, never taking more than you give.***************************************************************************** This file contains the C functions that implement date and time** functions for SQLite.  **** There is only one exported symbol in this file - the function** sqliteRegisterDateTimeFunctions() found at the bottom of the file.** All other code has file scope.**** $Id: qt/date.c   3.3.4   edited Mar 30 2004 $**** NOTES:**** SQLite processes all times and dates as Julian Day numbers.  The** dates and times are stored as the number of days since noon** in Greenwich on November 24, 4714 B.C. according to the Gregorian** calendar system.**** 1970-01-01 00:00:00 is JD 2440587.5** 2000-01-01 00:00:00 is JD 2451544.5**** This implemention requires years to be expressed as a 4-digit number** which means that only dates between 0000-01-01 and 9999-12-31 can** be represented, even though julian day numbers allow a much wider** range of dates.**** The Gregorian calendar system is used for all dates and times,** even those that predate the Gregorian calendar.  Historians usually** use the Julian calendar for dates prior to 1582-10-15 and for some** dates afterwards, depending on locale.  Beware of this difference.**** The conversion algorithms are implemented based on descriptions** in the following text:****      Jean Meeus**      Astronomical Algorithms, 2nd Edition, 1998**      ISBM 0-943396-61-1**      Willmann-Bell, Inc**      Richmond, Virginia (USA)*/#include "os.h"#include "sqliteInt.h"#include <ctype.h>#include <stdlib.h>#include <assert.h>#include <time.h>#ifndef SQLITE_OMIT_DATETIME_FUNCS/*** A structure for holding a single date and time.*/typedef struct DateTime DateTime;struct DateTime {  double rJD;      /* The julian day number */  int Y, M, D;     /* Year, month, and day */  int h, m;        /* Hour and minutes */  int tz;          /* Timezone offset in minutes */  double s;        /* Seconds */  char validYMD;   /* True if Y,M,D are valid */  char validHMS;   /* True if h,m,s are valid */  char validJD;    /* True if rJD is valid */  char validTZ;    /* True if tz is valid */};/*** Convert zDate into one or more integers.  Additional arguments** come in groups of 5 as follows:****       N       number of digits in the integer**       min     minimum allowed value of the integer**       max     maximum allowed value of the integer**       nextC   first character after the integer**       pVal    where to write the integers value.**** Conversions continue until one with nextC==0 is encountered.** The function returns the number of successful conversions.*/static int getDigits(const char *zDate, ...){  va_list ap;  int val;  int N;  int min;  int max;  int nextC;  int *pVal;  int cnt = 0;  va_start(ap, zDate);  do{    N = va_arg(ap, int);    min = va_arg(ap, int);    max = va_arg(ap, int);    nextC = va_arg(ap, int);    pVal = va_arg(ap, int*);    val = 0;    while( N-- ){      if( !isdigit(*zDate) ){        return cnt;      }      val = val*10 + *zDate - '0';      zDate++;    }    if( val<min || val>max || (nextC!=0 && nextC!=*zDate) ){      return cnt;    }    *pVal = val;    zDate++;    cnt++;  }while( nextC );  return cnt;}/*** Read text from z[] and convert into a floating point number.  Return** the number of digits converted.*/static int getValue(const char *z, double *pR){  const char *zEnd;  *pR = sqliteAtoF(z, &zEnd);  return zEnd - z;}/*** Parse a timezone extension on the end of a date-time.** The extension is of the form:****        (+/-)HH:MM**** If the parse is successful, write the number of minutes** of change in *pnMin and return 0.  If a parser error occurs,** return 0.**** A missing specifier is not considered an error.*/static int parseTimezone(const char *zDate, DateTime *p){  int sgn = 0;  int nHr, nMn;  while( isspace(*zDate) ){ zDate++; }  p->tz = 0;  if( *zDate=='-' ){    sgn = -1;  }else if( *zDate=='+' ){    sgn = +1;  }else{    return *zDate!=0;  }  zDate++;  if( getDigits(zDate, 2, 0, 14, ':', &nHr, 2, 0, 59, 0, &nMn)!=2 ){    return 1;  }  zDate += 5;  p->tz = sgn*(nMn + nHr*60);  while( isspace(*zDate) ){ zDate++; }  return *zDate!=0;}/*** Parse times of the form HH:MM or HH:MM:SS or HH:MM:SS.FFFF.** The HH, MM, and SS must each be exactly 2 digits.  The** fractional seconds FFFF can be one or more digits.**** Return 1 if there is a parsing error and 0 on success.*/static int parseHhMmSs(const char *zDate, DateTime *p){  int h, m, s;  double ms = 0.0;  if( getDigits(zDate, 2, 0, 24, ':', &h, 2, 0, 59, 0, &m)!=2 ){    return 1;  }  zDate += 5;  if( *zDate==':' ){    zDate++;    if( getDigits(zDate, 2, 0, 59, 0, &s)!=1 ){      return 1;    }    zDate += 2;    if( *zDate=='.' && isdigit(zDate[1]) ){      double rScale = 1.0;      zDate++;      while( isdigit(*zDate) ){        ms = ms*10.0 + *zDate - '0';        rScale *= 10.0;        zDate++;      }      ms /= rScale;    }  }else{    s = 0;  }  p->validJD = 0;  p->validHMS = 1;  p->h = h;  p->m = m;  p->s = s + ms;  if( parseTimezone(zDate, p) ) return 1;  p->validTZ = p->tz!=0;  return 0;}/*** Convert from YYYY-MM-DD HH:MM:SS to julian day.  We always assume** that the YYYY-MM-DD is according to the Gregorian calendar.**** Reference:  Meeus page 61*/static void computeJD(DateTime *p){  int Y, M, D, A, B, X1, X2;  if( p->validJD ) return;  if( p->validYMD ){    Y = p->Y;    M = p->M;    D = p->D;  }else{    Y = 2000;  /* If no YMD specified, assume 2000-Jan-01 */    M = 1;    D = 1;  }  if( M<=2 ){    Y--;    M += 12;  }  A = Y/100;  B = 2 - A + (A/4);  X1 = 365.25*(Y+4716);  X2 = 30.6001*(M+1);  p->rJD = X1 + X2 + D + B - 1524.5;  p->validJD = 1;  p->validYMD = 0;  if( p->validHMS ){    p->rJD += (p->h*3600.0 + p->m*60.0 + p->s)/86400.0;    if( p->validTZ ){      p->rJD += p->tz*60/86400.0;      p->validHMS = 0;      p->validTZ = 0;    }  }}/*** Parse dates of the form****     YYYY-MM-DD HH:MM:SS.FFF**     YYYY-MM-DD HH:MM:SS**     YYYY-MM-DD HH:MM**     YYYY-MM-DD**** Write the result into the DateTime structure and return 0** on success and 1 if the input string is not a well-formed** date.*/static int parseYyyyMmDd(const char *zDate, DateTime *p){  int Y, M, D, neg;  if( zDate[0]=='-' ){    zDate++;    neg = 1;  }else{    neg = 0;  }  if( getDigits(zDate,4,0,9999,'-',&Y,2,1,12,'-',&M,2,1,31,0,&D)!=3 ){    return 1;  }  zDate += 10;  while( isspace(*zDate) ){ zDate++; }  if( parseHhMmSs(zDate, p)==0 ){    /* We got the time */  }else if( *zDate==0 ){    p->validHMS = 0;  }else{    return 1;  }  p->validJD = 0;  p->validYMD = 1;  p->Y = neg ? -Y : Y;  p->M = M;  p->D = D;  if( p->validTZ ){    computeJD(p);  }  return 0;}/*** Attempt to parse the given string into a Julian Day Number.  Return** the number of errors.**** The following are acceptable forms for the input string:****      YYYY-MM-DD HH:MM:SS.FFF  +/-HH:MM**      DDDD.DD **      now**** In the first form, the +/-HH:MM is always optional.  The fractional** seconds extension (the ".FFF") is optional.  The seconds portion** (":SS.FFF") is option.  The year and date can be omitted as long** as there is a time string.  The time string can be omitted as long** as there is a year and date.*/static int parseDateOrTime(const char *zDate, DateTime *p){  memset(p, 0, sizeof(*p));  if( parseYyyyMmDd(zDate,p)==0 ){    return 0;  }else if( parseHhMmSs(zDate, p)==0 ){    return 0;  }else if( sqliteStrICmp(zDate,"now")==0){    double r;    if( sqliteOsCurrentTime(&r)==0 ){      p->rJD = r;      p->validJD = 1;      return 0;    }    return 1;  }else if( sqliteIsNumber(zDate) ){    p->rJD = sqliteAtoF(zDate, 0);    p->validJD = 1;    return 0;  }  return 1;}/*** Compute the Year, Month, and Day from the julian day number.*/static void computeYMD(DateTime *p){  int Z, A, B, C, D, E, X1;  if( p->validYMD ) return;  if( !p->validJD ){    p->Y = 2000;    p->M = 1;    p->D = 1;  }else{    Z = p->rJD + 0.5;    A = (Z - 1867216.25)/36524.25;    A = Z + 1 + A - (A/4);    B = A + 1524;    C = (B - 122.1)/365.25;    D = 365.25*C;    E = (B-D)/30.6001;    X1 = 30.6001*E;    p->D = B - D - X1;    p->M = E<14 ? E-1 : E-13;    p->Y = p->M>2 ? C - 4716 : C - 4715;  }  p->validYMD = 1;}/*** Compute the Hour, Minute, and Seconds from the julian day number.*/static void computeHMS(DateTime *p){  int Z, s;  if( p->validHMS ) return;  Z = p->rJD + 0.5;  s = (p->rJD + 0.5 - Z)*86400000.0 + 0.5;  p->s = 0.001*s;  s = p->s;  p->s -= s;  p->h = s/3600;  s -= p->h*3600;  p->m = s/60;  p->s += s - p->m*60;  p->validHMS = 1;}/*** Compute both YMD and HMS*/static void computeYMD_HMS(DateTime *p){  computeYMD(p);  computeHMS(p);}/*** Clear the YMD and HMS and the TZ*/static void clearYMD_HMS_TZ(DateTime *p){  p->validYMD = 0;  p->validHMS = 0;  p->validTZ = 0;}/*** Compute the difference (in days) between localtime and UTC (a.k.a. GMT)** for the time value p where p is in UTC.*/static double localtimeOffset(DateTime *p){  DateTime x, y;  time_t t;  struct tm *pTm;  x = *p;  computeYMD_HMS(&x);  if( x.Y<1971 || x.Y>=2038 ){    x.Y = 2000;    x.M = 1;    x.D = 1;    x.h = 0;    x.m = 0;    x.s = 0.0;  } else {    int s = x.s + 0.5;    x.s = s;  }  x.tz = 0;  x.validJD = 0;  computeJD(&x);  t = (x.rJD-2440587.5)*86400.0 + 0.5;  sqliteOsEnterMutex();  pTm = localtime(&t);  y.Y = pTm->tm_year + 1900;  y.M = pTm->tm_mon + 1;  y.D = pTm->tm_mday;  y.h = pTm->tm_hour;  y.m = pTm->tm_min;  y.s = pTm->tm_sec;  sqliteOsLeaveMutex();  y.validYMD = 1;  y.validHMS = 1;  y.validJD = 0;  y.validTZ = 0;  computeJD(&y);  return y.rJD - x.rJD;}/*** Process a modifier to a date-time stamp.  The modifiers are** as follows:

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美精品一区二区三区久久久| 亚洲精选在线视频| 亚洲色图19p| 精品一区免费av| 色综合久久中文字幕| 欧美成人性战久久| 亚洲综合视频网| 成人免费视频视频| 久久综合久久综合九色| 性欧美大战久久久久久久久| 99国产欧美久久久精品| 久久嫩草精品久久久精品| 亚洲gay无套男同| 在线这里只有精品| 国产精品二区一区二区aⅴ污介绍| 精品一区二区在线看| 777色狠狠一区二区三区| 亚洲一区免费在线观看| 色噜噜夜夜夜综合网| 亚洲欧洲性图库| 成人午夜电影网站| 国产欧美精品区一区二区三区 | 国产精品久久久久久久久果冻传媒| 秋霞午夜鲁丝一区二区老狼| 欧美巨大另类极品videosbest| 亚洲色图一区二区三区| 99久久婷婷国产| 亚洲日本欧美天堂| 91色视频在线| 亚洲五码中文字幕| 欧美日韩亚洲不卡| 同产精品九九九| 欧美精品在线观看一区二区| 亚洲一区二区av在线| 欧美日韩一区二区三区高清| 亚州成人在线电影| 欧美一区午夜视频在线观看| 免费视频最近日韩| 日韩视频一区二区三区| 另类小说一区二区三区| 久久综合色一综合色88| 国产一区二区精品久久99| 日本一区二区三区高清不卡| 粉嫩绯色av一区二区在线观看| 国产suv精品一区二区三区| 欧美日韩一卡二卡三卡| 视频一区欧美精品| 欧美一级一区二区| 久久99精品国产麻豆婷婷| 亚洲综合男人的天堂| 在线欧美日韩国产| 免费成人在线观看| 久久九九久久九九| 一本在线高清不卡dvd| 午夜精品福利一区二区蜜股av| 欧美一级在线观看| www.欧美.com| 婷婷亚洲久悠悠色悠在线播放 | 一本久久综合亚洲鲁鲁五月天| 亚洲精品视频在线| 日韩午夜激情av| 成人毛片视频在线观看| 亚洲午夜免费视频| 精品国产三级a在线观看| 白白色亚洲国产精品| 亚洲.国产.中文慕字在线| 欧美一区二区在线视频| 亚洲一二三四久久| 亚洲精品在线一区二区| eeuss鲁片一区二区三区| 亚洲一区二区三区四区不卡| 久久综合色8888| 欧洲人成人精品| 国产美女在线精品| 亚洲成年人网站在线观看| 久久亚洲一级片| 欧美色大人视频| 成人永久看片免费视频天堂| 午夜精品久久久久久久| 国产网站一区二区| 6080国产精品一区二区| 99久久精品国产一区| 久久国产尿小便嘘嘘尿| 亚洲精品视频在线观看网站| 国产日韩一级二级三级| 欧美不卡在线视频| 欧美日韩免费一区二区三区视频| 成人免费视频免费观看| 九一久久久久久| 爽好多水快深点欧美视频| 国产精品电影一区二区| 久久精品日产第一区二区三区高清版| 91国偷自产一区二区使用方法| 国产精品18久久久久久久久 | 九色综合狠狠综合久久| 亚洲超碰97人人做人人爱| 国产精品毛片久久久久久| 日韩一区二区在线免费观看| 欧美午夜一区二区三区| 95精品视频在线| 国产成人精品1024| 国产在线精品免费av| 日韩国产欧美在线视频| 亚洲丰满少妇videoshd| 亚洲午夜一二三区视频| 一区二区三区高清在线| 亚洲乱码一区二区三区在线观看| 国产视频视频一区| 久久久久国产成人精品亚洲午夜| 欧美成人精品1314www| 日韩一区二区三区在线| 91精品国产全国免费观看| 欧美日韩高清在线播放| 777亚洲妇女| 日韩精品一区二区三区视频在线观看| 欧美精品aⅴ在线视频| 欧美夫妻性生活| 欧美日本精品一区二区三区| 欧美主播一区二区三区美女| 91成人网在线| 欧美一级淫片007| 日韩亚洲国产中文字幕欧美| 日韩一级黄色大片| 精品国产一区二区三区久久影院| 欧美精品一区二区精品网| 久久久五月婷婷| 中文字幕一区二区三区精华液 | 欧洲精品视频在线观看| 欧美性猛交一区二区三区精品| 在线看国产日韩| 欧美一级片免费看| 久久久激情视频| 亚洲欧洲色图综合| 天堂av在线一区| 国产乱码精品一区二区三区av| 成人一区二区三区在线观看 | 99re热视频精品| 欧美丝袜自拍制服另类| 日韩一级完整毛片| 亚洲国产精品精华液2区45| 亚洲美女淫视频| 美日韩一区二区| 成人国产精品免费观看视频| 91久久精品日日躁夜夜躁欧美| 在线播放日韩导航| 国产性天天综合网| 亚洲影视资源网| 国产永久精品大片wwwapp| 色天天综合色天天久久| 日韩免费视频线观看| 亚洲色欲色欲www| 美女爽到高潮91| 91美女在线视频| 日韩精品自拍偷拍| 亚洲人成7777| 国产乱码精品一区二区三| 欧美色区777第一页| 久久久午夜精品理论片中文字幕| 一区二区三区日韩欧美| 久久精品国产一区二区三| 91麻豆精品秘密| 26uuuu精品一区二区| 亚洲国产日产av| 成人黄色软件下载| 日韩欧美一区二区不卡| 一区二区三区四区蜜桃| 国产精品456露脸| 欧美一区二区三区啪啪| 亚洲黄色尤物视频| 国产成人免费视| 日韩一区二区三区精品视频| 亚洲视频一二三区| 丁香激情综合国产| 精品国产乱码久久久久久蜜臀| 亚洲一区二区三区不卡国产欧美| 成人综合婷婷国产精品久久免费| 91精品免费在线| 一区二区三区欧美亚洲| 成人激情黄色小说| 国产日本欧美一区二区| 国模套图日韩精品一区二区| 制服丝袜亚洲网站| 亚洲高清视频的网址| 在线免费视频一区二区| 亚洲欧洲www| 99久久久久免费精品国产| 欧美国产97人人爽人人喊| 国产成人丝袜美腿| 久久久久久99久久久精品网站| 国产主播一区二区| 欧美tickle裸体挠脚心vk| 蜜桃在线一区二区三区| 91精品国产一区二区三区香蕉| 一区二区成人在线观看| 在线观看不卡一区| 亚洲电影你懂得| 欧美日韩视频在线一区二区| 亚洲激情第一区| 在线观看一区日韩| 亚洲第一会所有码转帖|