|
7 | 7 | *
|
8 | 8 | *
|
9 | 9 | * IDENTIFICATION
|
10 |
| - * $Header: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v 1.38 1999/07/17 20:17:55 momjian Exp $ |
| 10 | + * $Header: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v 1.39 2000/01/02 01:37:26 momjian Exp $ |
11 | 11 | *
|
12 | 12 | *-------------------------------------------------------------------------
|
13 | 13 | */
|
@@ -48,9 +48,6 @@ date_in(char *str)
|
48 | 48 | if (!PointerIsValid(str))
|
49 | 49 | elog(ERROR,"Bad (null) date external representation",NULL);
|
50 | 50 |
|
51 |
| -#ifdefDATEDEBUG |
52 |
| -printf("date_in- input string is %s\n",str); |
53 |
| -#endif |
54 | 51 | if ((ParseDateTime(str,lowstr,field,ftype,MAXDATEFIELDS,&nf)!=0)
|
55 | 52 | || (DecodeDateTime(field,ftype,nf,&dtype,tm,&fsec,&tzp)!=0))
|
56 | 53 | elog(ERROR,"Bad date external representation '%s'",str);
|
@@ -204,11 +201,6 @@ date_datetime(DateADT dateVal)
|
204 | 201 | if (date2tm(dateVal,&tz,tm,&fsec,&tzn)!=0)
|
205 | 202 | elog(ERROR,"Unable to convert date to datetime",NULL);
|
206 | 203 |
|
207 |
| -#ifdefDATEDEBUG |
208 |
| -printf("date_datetime- date is %d.%02d.%02d\n",tm->tm_year,tm->tm_mon,tm->tm_mday); |
209 |
| -printf("date_datetime- time is %02d:%02d:%02d %.7f\n",tm->tm_hour,tm->tm_min,tm->tm_sec,fsec); |
210 |
| -#endif |
211 |
| - |
212 | 204 | if (tm2datetime(tm,fsec,&tz,result)!=0)
|
213 | 205 | elog(ERROR,"Datetime out of range",NULL);
|
214 | 206 |
|
@@ -330,17 +322,6 @@ date2tm(DateADT dateVal, int *tzp, struct tm * tm, double *fsec, char **tzn)
|
330 | 322 | #ifdefUSE_POSIX_TIME
|
331 | 323 | tx=localtime(&utime);
|
332 | 324 |
|
333 |
| -#ifdefDATEDEBUG |
334 |
| -#if defined(HAVE_TM_ZONE) |
335 |
| -printf("date2tm- (localtime) %d.%02d.%02d %02d:%02d:%02.0f %s dst=%d\n", |
336 |
| -tx->tm_year,tx->tm_mon,tx->tm_mday,tx->tm_hour,tx->tm_min, (double)tm->tm_sec, |
337 |
| -tx->tm_zone,tx->tm_isdst); |
338 |
| -#elif defined(HAVE_INT_TIMEZONE) |
339 |
| -printf("date2tm- (localtime) %d.%02d.%02d %02d:%02d:%02.0f %s %s dst=%d\n", |
340 |
| -tx->tm_year,tx->tm_mon,tx->tm_mday,tx->tm_hour,tx->tm_min, (double)tm->tm_sec, |
341 |
| -tzname[0],tzname[1],tx->tm_isdst); |
342 |
| -#endif |
343 |
| -#endif |
344 | 325 | tm->tm_year=tx->tm_year+1900;
|
345 | 326 | tm->tm_mon=tx->tm_mon+1;
|
346 | 327 | tm->tm_mday=tx->tm_mday;
|
@@ -375,29 +356,12 @@ date2tm(DateADT dateVal, int *tzp, struct tm * tm, double *fsec, char **tzn)
|
375 | 356 | }
|
376 | 357 | else
|
377 | 358 | {
|
378 |
| -#ifdefDATEDEBUG |
379 |
| -printf("date2tm- convert %d-%d-%d %d:%d%d to datetime\n", |
380 |
| -tm->tm_year,tm->tm_mon,tm->tm_mday,tm->tm_hour,tm->tm_min,tm->tm_sec); |
381 |
| -#endif |
382 |
| - |
383 | 359 | *tzp=0;
|
384 | 360 | tm->tm_isdst=0;
|
385 | 361 | if (tzn!=NULL)
|
386 | 362 | *tzn=NULL;
|
387 | 363 | }
|
388 | 364 |
|
389 |
| -#ifdefDATEDEBUG |
390 |
| -#if defined(HAVE_TM_ZONE) |
391 |
| -printf("date2tm- %d.%02d.%02d %02d:%02d:%02.0f (%d %s) dst=%d\n", |
392 |
| -tm->tm_year,tm->tm_mon,tm->tm_mday,tm->tm_hour,tm->tm_min, (double)tm->tm_sec, |
393 |
| -*tzp,tm->tm_zone,tm->tm_isdst); |
394 |
| -#elif defined(HAVE_INT_TIMEZONE) |
395 |
| -printf("date2tm- %d.%02d.%02d %02d:%02d:%02.0f (%d %s %s) dst=%d\n", |
396 |
| -tm->tm_year,tm->tm_mon,tm->tm_mday,tm->tm_hour,tm->tm_min, (double)tm->tm_sec, |
397 |
| -*tzp,tzname[0],tzname[1],tm->tm_isdst); |
398 |
| -#endif |
399 |
| -#endif |
400 |
| - |
401 | 365 | return0;
|
402 | 366 | }/* date2tm() */
|
403 | 367 |
|
|