/* FBDateSupport.h created by fb on Mon 28-Dec-1998 */

#ifndef FBCDateSupport__H
#define FBCDateSupport__H

#ifndef FBVersion
#define FBVersion 7
#elif FBVersion != 7
#error "The headers for FBCAccess version have been mixed"
#endif

#include "FBCTimeZones.h"

#ifdef __cplusplus
extern "C" {
#endif

int  fbcdsDaysInMonth(int month);
int  fbcdsIsLeapYear(int year);
int  fbcdsConvertYearToDays(int year);

void fbcdsConvertDateToYearMonthDay(double date, int* year, int* month, int* day);
void fbcdsConvertTimeToHourMinuteSeconds(double time, int* hour, int* minute, double* seconds);
void fbcdsConvertTimestampToDateAndTime(double timestamp, double* datePart, double* timePart);

void fbcdsBuildTimeString(char* str, double time, unsigned tzSign, int tzValue, unsigned datatype);
void fbcdsBuildTimeStringP(char* str, double time, unsigned tzSign, int tzValue, unsigned datatype, unsigned precision);

void fbcdsBuildTimestampString(char* str, double timestamp, unsigned tzSign, int tzValue, unsigned dataType, FBCTimeZone* timeZone);
void fbcdsBuildTimestampStringP(char* str, double timestamp, unsigned tzSign, int tzValue, unsigned dataType, FBCTimeZone* timeZone, unsigned precision);
   

#ifdef __cplusplus
}
#endif

#endif /* FBCDateSupport__H */
