RWDBDateTime is Returning an Incorrect Time

Article ID: 878
Last updated: 03 Aug, 2009
Article ID: 878
Last updated: 03 Aug, 2009
Revision: 1
Views: 32118
Posted: 21 Apr, 1999
by --
Updated: 03 Aug, 2009
by

Problem



RWDBDateTime is returning an incorrect time or date that is offset by a certain amount of time (i.e. 5 hours, 8 hours, etc.)


Cause



This error stems from the usage of unsigned longs to represent dates/time.


Action



This bug has been fixed in DBTools 3.1.1. If you are unable to upgrade to DBTools 3.1.1, the following change to the file datetime.cpp will alleviate this error: In //parts/dbt0310w/source/src/datetime.cpp starting about line #61, change:

#define RWDB_MONTHS_IN_YEAR          12U
#define RWDB_HOURS_IN_DAY            24U 
#define RWDB_MINUTES_IN_DAY          1440U
#define RWDB_SECONDS_IN_DAY          86400UL
#define RWDB_MILLISECONDS_IN_DAY     86400000UL
#define RWDB_MILLISECONDS_IN_HOUR    3600000UL
#define RWDB_MILLISECONDS_IN_MIN     60000UL
#define RWDB_MILLISECONDS_IN_SEC     1000U

To this:

#define RWDB_MONTHS_IN_YEAR          12
#define RWDB_HOURS_IN_DAY            24
#define RWDB_MINUTES_IN_DAY          1440
#define RWDB_SECONDS_IN_DAY          86400L
#define RWDB_MILLISECONDS_IN_DAY     86400000L
#define RWDB_MILLISECONDS_IN_HOUR    3600000L
#define RWDB_MILLISECONDS_IN_MIN     60000L
#define RWDB_MILLISECONDS_IN_SEC     1000L


You will then need to recompile your DBTools libraries for the change to take effect.

This article was:   Helpful | Not helpful
Report an issue
Article ID: 878
Last updated: 03 Aug, 2009
Revision: 1
Views: 32118
Posted: 21 Apr, 1999 by --
Updated: 03 Aug, 2009 by

Others in this category