index 43148bec90d5e07080fd9f563f4ca9ce8342aab1..85450e12cdb9b951926b761ee1937eed4332f245 100644 (file)
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/date.c,v 1.146 2009年06月11日 14:49:03 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/date.c,v 1.147 2009年07月29日 22:19:18 tgl Exp $
*
*-------------------------------------------------------------------------
*/
{
case DTK_MICROSEC:
#ifdef HAVE_INT64_TIMESTAMP
- result = tm->tm_sec * USECS_PER_SEC + fsec;
+ result = tm->tm_sec * 1000000.0 + fsec;
#else
result = (tm->tm_sec + fsec) * 1000000;
#endif
case DTK_MILLISEC:
#ifdef HAVE_INT64_TIMESTAMP
- result = tm->tm_sec * INT64CONST(1000) + fsec / INT64CONST(1000);
+ result = tm->tm_sec * 1000.0 + fsec / 1000.0;
#else
result = (tm->tm_sec + fsec) * 1000;
#endif
case DTK_SECOND:
#ifdef HAVE_INT64_TIMESTAMP
- result = tm->tm_sec + fsec / USECS_PER_SEC;
+ result = tm->tm_sec + fsec / 1000000.0;
#else
result = tm->tm_sec + fsec;
#endif
case DTK_MICROSEC:
#ifdef HAVE_INT64_TIMESTAMP
- result = tm->tm_sec * USECS_PER_SEC + fsec;
+ result = tm->tm_sec * 1000000.0 + fsec;
#else
result = (tm->tm_sec + fsec) * 1000000;
#endif
case DTK_MILLISEC:
#ifdef HAVE_INT64_TIMESTAMP
- result = tm->tm_sec * INT64CONST(1000) + fsec / INT64CONST(1000);
+ result = tm->tm_sec * 1000.0 + fsec / 1000.0;
#else
result = (tm->tm_sec + fsec) * 1000;
#endif
case DTK_SECOND:
#ifdef HAVE_INT64_TIMESTAMP
- result = tm->tm_sec + fsec / USECS_PER_SEC;
+ result = tm->tm_sec + fsec / 1000000.0;
#else
result = tm->tm_sec + fsec;
#endif