1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

Add the ability to disable the "localtime" modifier in the date/time

functions.  This might be necessary for systems that do not support
localtime_r() or localtime_s(). (CVS 5212)

FossilOrigin-Name: 12f3ba11e72b2310abf51d040d5344c81fe5ebd3
This commit is contained in:
drh
2008-06-12 12:51:37 +00:00
parent be4076e084
commit 66147c9715
4 changed files with 20 additions and 10 deletions

View File

@@ -16,7 +16,7 @@
** sqlite3RegisterDateTimeFunctions() found at the bottom of the file.
** All other code has file scope.
**
** $Id: date.c,v 1.80 2008/05/27 19:49:21 shane Exp $
** $Id: date.c,v 1.81 2008/06/12 12:51:37 drh Exp $
**
** SQLite processes all times and dates as Julian Day numbers. The
** dates and times are stored as the number of days since noon
@@ -416,6 +416,7 @@ static void clearYMD_HMS_TZ(DateTime *p){
p->validTZ = 0;
}
#ifndef SQLITE_OMIT_LOCALTIME
/*
** Compute the difference (in days) between localtime and UTC (a.k.a. GMT)
** for the time value p where p is in UTC.
@@ -483,6 +484,7 @@ static double localtimeOffset(DateTime *p){
computeJD(&y);
return y.rJD - x.rJD;
}
#endif /* SQLITE_OMIT_LOCALTIME */
/*
** Process a modifier to a date-time stamp. The modifiers are
@@ -516,6 +518,7 @@ static int parseModifier(const char *zMod, DateTime *p){
}
z[n] = 0;
switch( z[0] ){
#ifndef SQLITE_OMIT_LOCALTIME
case 'l': {
/* localtime
**
@@ -530,6 +533,7 @@ static int parseModifier(const char *zMod, DateTime *p){
}
break;
}
#endif
case 'u': {
/*
** unixepoch