last set of zts fixes

This commit is contained in:
Ilia Alshanetsky 2006-11-30 16:38:37 +00:00
parent c69555b948
commit ca89b6dedd
4 changed files with 18 additions and 12 deletions

View file

@ -53,6 +53,7 @@
#include <stdlib.h>
#include <assert.h>
#include <time.h>
#include "main/php_reentrancy.h"
#ifndef SQLITE_OMIT_DATETIME_FUNCS
@ -393,7 +394,7 @@ static void clearYMD_HMS_TZ(DateTime *p){
static double localtimeOffset(DateTime *p){
DateTime x, y;
time_t t;
struct tm *pTm;
struct tm *pTm, tmbuf;
x = *p;
computeYMD_HMS(&x);
if( x.Y<1971 || x.Y>=2038 ){
@ -412,7 +413,8 @@ static double localtimeOffset(DateTime *p){
computeJD(&x);
t = (x.rJD-2440587.5)*86400.0 + 0.5;
sqlite3OsEnterMutex();
pTm = localtime(&t);
pTm = php_localtime_r
(&t, &tmbuf);
y.Y = pTm->tm_year + 1900;
y.M = pTm->tm_mon + 1;
y.D = pTm->tm_mday;