int tzoff;
struct pg_tm tm;
fsec_t fsec;
- char *tzn;
+ const char *tzn;
Interval *resInterval;
struct pg_tm itm;
{
struct pg_tm tm; /* classic 'tm' struct */
fsec_t fsec; /* fractional seconds */
- char *tzn; /* timezone */
+ const char *tzn; /* timezone */
} TmToChar;
#define tmtcTm(_X) (&(_X)->tm)
struct pg_tm tt,
*tm = &tt;
fsec_t fsec;
- char *tzn;
+ const char *tzn;
char buf[MAXDATELEN + 1];
if (TIMESTAMP_NOT_FINITE(dt))
struct pg_tm tt,
*tm = &tt;
fsec_t fsec;
- char *tzn;
+ const char *tzn;
if (TIMESTAMP_NOT_FINITE(t))
EncodeSpecialTimestamp(t, buf);
* timezone) will be used.
*/
int
-timestamp2tm(Timestamp dt, int *tzp, struct pg_tm * tm, fsec_t *fsec, char **tzn, pg_tz *attimezone)
+timestamp2tm(Timestamp dt, int *tzp, struct pg_tm * tm, fsec_t *fsec, const char **tzn, pg_tz *attimezone)
{
Timestamp date;
Timestamp time;
tm->tm_zone = tx->tm_zone;
*tzp = -tm->tm_gmtoff;
if (tzn != NULL)
- *tzn = (char *) tm->tm_zone;
+ *tzn = tm->tm_zone;
}
else
{
struct pg_tm tm;
int tz;
fsec_t fsec;
- char *tzn = NULL;
+ const char *tzn = NULL;
char buf[MAXDATELEN + 1];
timestamp = DatumGetTimestamp(value);
extern int tm2timestamp(struct pg_tm * tm, fsec_t fsec, int *tzp, Timestamp *dt);
extern int timestamp2tm(Timestamp dt, int *tzp, struct pg_tm * tm,
- fsec_t *fsec, char **tzn, pg_tz *attimezone);
+ fsec_t *fsec, const char **tzn, pg_tz *attimezone);
extern void dt2time(Timestamp dt, int *hour, int *min, int *sec, fsec_t *fsec);
extern int interval2tm(Interval span, struct pg_tm * tm, fsec_t *fsec);
* local time zone. If out of this range, leave as GMT. - tgl 97/05/27
*/
static int
-timestamp2tm(timestamp dt, int *tzp, struct tm * tm, fsec_t *fsec, char **tzn)
+timestamp2tm(timestamp dt, int *tzp, struct tm * tm, fsec_t *fsec, const char **tzn)
{
#ifdef HAVE_INT64_TIMESTAMP
int64 dDate,
*tzp = -tm->tm_gmtoff; /* tm_gmtoff is Sun/DEC-ism */
if (tzn != NULL)
- *tzn = (char *) tm->tm_zone;
+ *tzn = tm->tm_zone;
#elif defined(HAVE_INT_TIMEZONE)
*tzp = (tm->tm_isdst > 0) ? TIMEZONE_GLOBAL - SECS_PER_HOUR : TIMEZONE_GLOBAL;
if (tzn != NULL)