#include <DataType.h>
Collaboration diagram for TimeStamp:
Public Member Functions | |
TimeStamp () | |
TimeStamp (int year, int month, int day, int hour, int minute, int sec, int usec=0) | |
Overloaded constructor. | |
TimeStamp (const TimeStamp &ts) | |
TimeStamp (const Date &d, Time &t) | |
TimeStamp & | operator= (const TimeStamp &d2) |
int | getDate (int &year, int &month, int &day) |
get year, month, day from the date part of the timestamp | |
void | getDate (Date &newDate) const |
get the date part of the timestamp | |
int | setDate (int year, int month, int day) |
sets the date with specified year, month, day | |
void | setDate (const Date &newDate) |
set the date part of the timestamp | |
operator Date () | |
operator Time () | |
int | getTime (int &hours, int &mins, int &secs) const |
retrieves the time using IN parameters | |
void | getTime (Time &newTime) const |
retrieves the time part of the timestamp | |
int | setTime (int hours, int mins, int secs, int usec=0) |
sets the time with specified hours, mins, secs | |
void | setTime (const Time &newTime) |
set the time part of the timestamp | |
bool | isValid () const |
checks for the validity of the timestamp | |
void | setNull () |
resets the date and time | |
int | dayOfWeek () const |
returns day of the week. | |
const char * | dayOfWeekName () const |
returns day of the week. | |
const char * | dayOfWeekAbbr () const |
returns day of the week abbreviation values are "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" | |
int | dayOfMonth () const |
returns the day of the month. | |
int | dayOfYear () const |
int | month () const |
returns the month. | |
const char * | monthName () const |
returns the month name values are "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" | |
const char * | monthAbbr () const |
returns the month name abbreviation Values are "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" | |
int | year () const |
returns the year | |
int | secondsSinceMidnight () const |
int | seconds () const |
returns the seconds | |
int | minutes () const |
returns the minutes | |
int | hours () const |
returns the hours | |
int | msec () const |
returns the millisecs | |
int | usec () const |
returns the microsecs | |
int | setMsec (int ms) |
sets the millisecs | |
int | setUsec (int us) |
sets the microsecs | |
int | parseDateFrom (const char *s) |
parses the date string passed and stores it It should of the format "mm/dd/yyyy" | |
int | parseTimeFrom (const char *s) |
parses the time string passed and stores it It should of the format "hh:mm::ss" | |
int | parseFrom (const char *s) |
Friends | |
int | operator< (const TimeStamp &d1, const TimeStamp &d2) |
int | operator> (const TimeStamp &d1, const TimeStamp &d2) |
int | operator<= (const TimeStamp &d1, const TimeStamp &d2) |
int | operator>= (const TimeStamp &d1, const TimeStamp &d2) |
int | operator== (const TimeStamp &d1, const TimeStamp &d2) |
int | operator!= (const TimeStamp &d1, const TimeStamp &d2) |
Definition at line 454 of file DataType.h.
TimeStamp::TimeStamp | ( | ) | [inline] |
TimeStamp::TimeStamp | ( | int | year, | |
int | month, | |||
int | day, | |||
int | hour, | |||
int | minute, | |||
int | sec, | |||
int | usec = 0 | |||
) | [inline] |
Overloaded constructor.
year | year | |
month | month | |
day | day | |
hours | hours | |
mins | mins | |
secs | secs | |
usec | usec |
Definition at line 468 of file DataType.h.
TimeStamp::TimeStamp | ( | const TimeStamp & | ts | ) | [inline] |
int TimeStamp::dayOfMonth | ( | ) | const [inline] |
returns the day of the month.
Values are 1 to 31
Definition at line 565 of file DataType.h.
References Date::dayOfMonth().
Referenced by AllDataType::convertToString(), SqlOdbcStatement::execute(), Java_csql_jdbc_JSqlStatement_getTimestamp(), and AllDataType::printVal().
00565 { return date.dayOfMonth(); }
Here is the call graph for this function:
Here is the caller graph for this function:
int TimeStamp::dayOfWeek | ( | ) | const [inline] |
returns day of the week.
Values are 1-7
Definition at line 550 of file DataType.h.
References Date::dayOfWeek().
00550 { return date.dayOfWeek(); }
Here is the call graph for this function:
const char* TimeStamp::dayOfWeekAbbr | ( | ) | const [inline] |
returns day of the week abbreviation values are "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
Definition at line 561 of file DataType.h.
References Date::dayOfWeekAbbr().
00561 { return date.dayOfWeekAbbr(); }
Here is the call graph for this function:
const char* TimeStamp::dayOfWeekName | ( | ) | const [inline] |
returns day of the week.
values are "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Satur day".
Definition at line 556 of file DataType.h.
References Date::dayOfWeekName().
00556 { return date.dayOfWeekName(); }
Here is the call graph for this function:
int TimeStamp::dayOfYear | ( | ) | const [inline] |
Definition at line 566 of file DataType.h.
References Date::dayOfYear().
00566 { return date.dayOfYear(); }
Here is the call graph for this function:
void TimeStamp::getDate | ( | Date & | newDate | ) | const [inline] |
int TimeStamp::getDate | ( | int & | year, | |
int & | month, | |||
int & | day | |||
) | [inline] |
get year, month, day from the date part of the timestamp
year | year IN | |
month | month IN | |
day | day IN |
Definition at line 484 of file DataType.h.
References Date::get().
Here is the call graph for this function:
void TimeStamp::getTime | ( | Time & | newTime | ) | const [inline] |
retrieves the time part of the timestamp
newTime | Time |
Definition at line 523 of file DataType.h.
int TimeStamp::getTime | ( | int & | hours, | |
int & | mins, | |||
int & | secs | |||
) | const [inline] |
retrieves the time using IN parameters
hours | hours | |
mins | mins | |
secs | secs |
Definition at line 518 of file DataType.h.
References Time::get().
Here is the call graph for this function:
int TimeStamp::hours | ( | ) | const [inline] |
returns the hours
Definition at line 595 of file DataType.h.
References Time::hours().
Referenced by AllDataType::convertToString(), SqlOdbcStatement::execute(), Java_csql_jdbc_JSqlStatement_getTimestamp(), parseFrom(), and AllDataType::printVal().
00595 { return time.hours(); }
Here is the call graph for this function:
Here is the caller graph for this function:
bool TimeStamp::isValid | ( | ) | const [inline] |
checks for the validity of the timestamp
Definition at line 543 of file DataType.h.
References Time::isValid(), and Date::isValid().
Here is the call graph for this function:
int TimeStamp::minutes | ( | ) | const [inline] |
returns the minutes
Definition at line 593 of file DataType.h.
References Time::minutes().
Referenced by AllDataType::convertToString(), SqlOdbcStatement::execute(), Java_csql_jdbc_JSqlStatement_getTimestamp(), and AllDataType::printVal().
00593 { return time.minutes(); }
Here is the call graph for this function:
Here is the caller graph for this function:
int TimeStamp::month | ( | ) | const [inline] |
returns the month.
Values are 1 to 12.
Definition at line 571 of file DataType.h.
References Date::month().
Referenced by AllDataType::convertToString(), SqlOdbcStatement::execute(), Java_csql_jdbc_JSqlStatement_getTimestamp(), parseFrom(), and AllDataType::printVal().
00571 { return date.month(); }
Here is the call graph for this function:
Here is the caller graph for this function:
const char* TimeStamp::monthAbbr | ( | ) | const [inline] |
returns the month name abbreviation Values are "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
Definition at line 583 of file DataType.h.
References Date::monthAbbr().
00583 { return date.monthAbbr(); }
Here is the call graph for this function:
const char* TimeStamp::monthName | ( | ) | const [inline] |
returns the month name values are "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
Definition at line 577 of file DataType.h.
References Date::monthName().
00577 { return date.monthName(); }
Here is the call graph for this function:
int TimeStamp::msec | ( | ) | const [inline] |
returns the millisecs
Definition at line 597 of file DataType.h.
References Time::msec().
00597 { return time.msec(); }
Here is the call graph for this function:
TimeStamp::operator Date | ( | ) | [inline] |
TimeStamp::operator Time | ( | ) | [inline] |
int TimeStamp::parseDateFrom | ( | const char * | s | ) | [inline] |
parses the date string passed and stores it It should of the format "mm/dd/yyyy"
Definition at line 609 of file DataType.h.
References Date::parseFrom().
00609 { return date.parseFrom(s); }
Here is the call graph for this function:
int TimeStamp::parseFrom | ( | const char * | s | ) |
Definition at line 291 of file DataType.cxx.
References hours(), Date::isValidDate(), Time::isValidTime(), month(), setDate(), setTime(), and year().
Referenced by AllDataType::convertToTimeStamp().
00291 { 00292 int hours,mins,secs; 00293 int month,day,year; 00294 int count; 00295 count = sscanf(s,"%d/%d/%d %d:%d:%d",&year,&month,&day, &hours, &mins, &secs); 00296 if (count < 5) return -1; 00297 if (count == 5) secs = 0; 00298 00299 if (year < 100) year += 1900; 00300 00301 if (!date.isValidDate(year, month, day)) 00302 return -1; 00303 00304 setDate(year,month,day); 00305 00306 00307 if (!time.isValidTime(hours,mins,secs)) 00308 return -1; 00309 return setTime(hours,mins,secs); 00310 }
Here is the call graph for this function:
Here is the caller graph for this function:
int TimeStamp::parseTimeFrom | ( | const char * | s | ) | [inline] |
parses the time string passed and stores it It should of the format "hh:mm::ss"
Definition at line 615 of file DataType.h.
References Time::parseFrom().
00615 { return time.parseFrom(s); }
Here is the call graph for this function:
int TimeStamp::seconds | ( | ) | const [inline] |
returns the seconds
Definition at line 591 of file DataType.h.
References Time::seconds().
Referenced by AllDataType::convertToString(), SqlOdbcStatement::execute(), Java_csql_jdbc_JSqlStatement_getTimestamp(), and AllDataType::printVal().
00591 { return time.seconds(); }
Here is the call graph for this function:
Here is the caller graph for this function:
int TimeStamp::secondsSinceMidnight | ( | ) | const [inline] |
Definition at line 589 of file DataType.h.
References Time::secondsSinceMidnight().
00589 { return time.secondsSinceMidnight(); }
Here is the call graph for this function:
void TimeStamp::setDate | ( | const Date & | newDate | ) | [inline] |
int TimeStamp::setDate | ( | int | year, | |
int | month, | |||
int | day | |||
) | [inline] |
sets the date with specified year, month, day
year | year | |
month | month | |
day | day |
Definition at line 498 of file DataType.h.
References Date::set().
Referenced by copyFromOdbc(), SqlOdbcStatement::fetch(), SqlOdbcStatement::fetchAndPrint(), CacheTableLoader::load(), and parseFrom().
Here is the call graph for this function:
Here is the caller graph for this function:
int TimeStamp::setMsec | ( | int | ms | ) | [inline] |
sets the millisecs
Definition at line 602 of file DataType.h.
References Time::setMsec().
00602 { return time.setMsec(ms) ; }
Here is the call graph for this function:
void TimeStamp::setNull | ( | ) | [inline] |
resets the date and time
Definition at line 546 of file DataType.h.
References Time::setNull(), and Date::setNull().
Here is the call graph for this function:
void TimeStamp::setTime | ( | const Time & | newTime | ) | [inline] |
set the time part of the timestamp
newTime | Time |
Definition at line 538 of file DataType.h.
int TimeStamp::setTime | ( | int | hours, | |
int | mins, | |||
int | secs, | |||
int | usec = 0 | |||
) | [inline] |
sets the time with specified hours, mins, secs
hours | hours | |
mins | mins | |
secs | secs | |
usec | usec |
Definition at line 532 of file DataType.h.
References Time::set(), and usec().
Referenced by copyFromOdbc(), SqlOdbcStatement::fetch(), SqlOdbcStatement::fetchAndPrint(), CacheTableLoader::load(), and parseFrom().
Here is the call graph for this function:
Here is the caller graph for this function:
int TimeStamp::setUsec | ( | int | us | ) | [inline] |
sets the microsecs
Definition at line 604 of file DataType.h.
References Time::setUsec().
00604 { return time.setUsec(us) ; }
Here is the call graph for this function:
int TimeStamp::usec | ( | ) | const [inline] |
returns the microsecs
Definition at line 599 of file DataType.h.
References Time::usec().
Referenced by setTime().
00599 { return time.usec(); }
Here is the call graph for this function:
Here is the caller graph for this function:
int TimeStamp::year | ( | ) | const [inline] |
returns the year
Definition at line 587 of file DataType.h.
References Date::year().
Referenced by AllDataType::convertToString(), SqlOdbcStatement::execute(), Java_csql_jdbc_JSqlStatement_getTimestamp(), parseFrom(), and AllDataType::printVal().
00587 { return date.year(); }
Here is the call graph for this function:
Here is the caller graph for this function: