// dtime.h - DOUBLE TIME FUNCTION DECLARATIONS // // MAINTENANCE HISTORY // DATE PROGRAMMER AND DETAILS // 01-09-08 JS Original // //----------------------------------------------------------------------------- typedef double Dtime_t; // Double time data type static const Dtime_t NULL_DTIME = -(65536.0*65536.0*65536.0*65536.0); // Reserved double time value (before the big // bang) used to represent an invalid time Dtime_t PackDtime (int yr, int mo, int dy, int hr, int mi, int se); // Pack a double time value from its // components. void UnpackDtime (Dtime_t, int*y4, int*mo, int*dy, int*hr, int*mi, int*se); // Unpack a double time value into its // components. Dtime_t DtimeFromSql (const char *sqlTime); // Convert an SQL date or timestamp string // into the double time format. char *SqlDateFromDtime (char *sqlDate, Dtime_t dtime); // Convert a double time value into an // SQL date string. Return sqlDate. char *SqlTimestampFromDtime (char *sqlTimestamp, Dtime_t dtime); // Convert a double time value into an // SQL timestamp string. Return sqlTimestamp. Dtime_t DtimeFromUserDate (const char *userDate); // Convert a user date in DD-MM-YY format into // the double time format. char *UserDateFromDtime (char *userDate, Dtime_t dtime); // Convert the date components of a double // time value into a user date string in // DD-MM-YY format. Return userDate. char *UserTimeFromDtime (char *userTime, Dtime_t dtime); // Convert the time components of a double // time value into a user time string in // DD-MM-YY format. Return userTime.