*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/datetime.c,v 1.139 2005/04/20 17:14:50 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/datetime.c,v 1.140 2005/05/21 03:38:05 momjian Exp $
*
*-------------------------------------------------------------------------
*/
return DTERR_FIELD_OVERFLOW;
/* timezone not specified? then find local timezone if possible */
- if ((tzp != NULL) && (!(fmask & DTK_M(TZ))))
+ if (tzp != NULL && !(fmask & DTK_M(TZ)))
{
/*
* daylight savings time modifier but no standard timezone?
return DTERR_BAD_FORMAT;
/* timezone not specified? then find local timezone if possible */
- if ((tzp != NULL) && (!(fmask & DTK_M(TZ))))
+ if (tzp != NULL && !(fmask & DTK_M(TZ)))
{
struct pg_tm tt,
*tmp = &tt;
* have alpha time zone info available. tm_isdst != -1
* indicates that we have a valid time zone translation.
*/
- if ((tzp != NULL) && (tm->tm_isdst >= 0))
+ if (tzp != NULL && tm->tm_isdst >= 0)
{
hour = -(*tzp / 3600);
min = ((abs(*tzp) / 60) % 60);
else
sprintf((str + strlen(str)), ":%02d", tm->tm_sec);
- if ((tzp != NULL) && (tm->tm_isdst >= 0))
+ if (tzp != NULL && tm->tm_isdst >= 0)
{
if (*tzn != NULL)
sprintf((str + strlen(str)), " %.*s", MAXTZLEN, *tzn);
else
sprintf((str + strlen(str)), ":%02d", tm->tm_sec);
- if ((tzp != NULL) && (tm->tm_isdst >= 0))
+ if (tzp != NULL && tm->tm_isdst >= 0)
{
if (*tzn != NULL)
sprintf((str + strlen(str)), " %.*s", MAXTZLEN, *tzn);
sprintf((str + strlen(str)), " %04d",
((tm->tm_year > 0) ? tm->tm_year : -(tm->tm_year - 1)));
- if ((tzp != NULL) && (tm->tm_isdst >= 0))
+ if (tzp != NULL && tm->tm_isdst >= 0)
{
if (*tzn != NULL)
sprintf((str + strlen(str)), " %.*s", MAXTZLEN, *tzn);
#ifdef HAVE_INT64_TIMESTAMP
sprintf(cp, ":%02d", abs(tm->tm_sec));
cp += strlen(cp);
- sprintf(cp, ".%06d", ((fsec >= 0) ? fsec : -(fsec)));
+ sprintf(cp, ".%06d", Abs(fsec));
#else
fsec += tm->tm_sec;
sprintf(cp, ":%013.10f", fabs(fsec));