Fri Oct 3 12:04:57 CEST 2003
- Hide Informix datatypes in PostgreSQL built process.
+
+Sun Oct 5 13:08:47 CEST 2003
+
+ - Fixed bug in day of week calculation.
- Set ecpg version to 3.0.0
- Set ecpg library to 4.0.0
- Set pgtypes library to 1.0.0
PGTYPESdate_dayofweek(date dDate)
{
/*
- * Sunday: 0 Monday: 1 Tuesday: 2 Wednesday: 3
+ * Sunday: 0 Monday: 1 Tuesday: 2 Wednesday: 3
* Thursday: 4 Friday: 5 Saturday: 6
*/
- return 6 - j2day(dDate + 3);
+ return (int) (dDate + date2j(2000, 1, 1) + 1) % 7;
}
void
int DecodeUnits(int field, char *lowtoken, int *val);
bool ClearDateCache(bool, bool, bool);
-int j2day(int jd);
-
bool CheckDateTokenTables(void);
int EncodeDateOnly(struct tm *, int, char *, bool);
return;
} /* j2date() */
-int
-j2day(int date)
-{
- unsigned int day;
-
- day = date;
- day += 1;
- day %= 7;
- return (int) day;
-} /* j2day() */
-
/* DecodeSpecial()
* Decode text string using lookup table.
* Implement a cache lookup since it is likely that dates
/* Backward-compatible with traditional Postgres abstime dates */
day = date2j(tm->tm_year, tm->tm_mon, tm->tm_mday);
- tm->tm_wday = j2day(day);
+ tm->tm_wday = (int) ((day + date2j(2000, 1, 1) + 1) % 7);
strncpy(str, days[tm->tm_wday], 3);
strcpy((str + 3), " ");
#include "dt.h"
#include "pgtypes_timestamp.h"
#include "pgtypes_date.h"
-#include "datetime.h"
int PGTYPEStimestamp_defmt_scan(char **, char *, timestamp *, int *, int *, int *,
int *, int *, int *, int *);