version 1.46, 2004/12/19 00:15:57
|
version 1.47, 2005/01/04 12:16:14
|
|
|
void CIMDateTimeRep::set_data(const String & value, Uint32 index, Uint32 size) | void CIMDateTimeRep::set_data(const String & value, Uint32 index, Uint32 size) |
{ | { |
for (Uint32 i=0; i < size; i++) { | for (Uint32 i=0; i < size; i++) { |
data[index+i] = value[i]; |
data[index+i] = (char) value[i]; |
} | } |
} | } |
| |
|
|
| |
send string to set() | send string to set() |
*/ | */ |
CIMDateTime::CIMDateTime(const Uint64 microSec, Boolean interval) |
CIMDateTime::CIMDateTime(Uint64 microSec, Boolean interval) |
{ | { |
if (microSec >= _TEN_THOUSAND_YEARS && !interval) { //time stamps must be less then number of micro Seconds in 10,000 years | if (microSec >= _TEN_THOUSAND_YEARS && !interval) { //time stamps must be less then number of micro Seconds in 10,000 years |
MessageLoaderParms parmsTS("Common.Exception.DATETIME_OUT_OF_RANGE_EXCEPTION", | MessageLoaderParms parmsTS("Common.Exception.DATETIME_OUT_OF_RANGE_EXCEPTION", |
|
|
//Set of Strings that hold part parts of datetime 100,000,000 | //Set of Strings that hold part parts of datetime 100,000,000 |
String year, ye_mo, ye_mo_da, ye_mo_da_ho, ye_mo_da_ho_mn, ye_mo_da_ho_mn_se, final; | String year, ye_mo, ye_mo_da, ye_mo_da_ho, ye_mo_da_ho_mn, ye_mo_da_ho_mn_se, final; |
| |
Uint32 day_sub1 = microSec/_ONE_DAY; |
Uint32 day_sub1 = (Uint32)(microSec/_ONE_DAY); |
Uint32 days_in400 = 146097; | Uint32 days_in400 = 146097; |
| |
if (!interval) { | if (!interval) { |
|
|
//get hours, minutes, seconds and microseconds | //get hours, minutes, seconds and microseconds |
Uint64 after_ymd = microSec%_ONE_DAY; | Uint64 after_ymd = microSec%_ONE_DAY; |
| |
Uint32 hour_num = after_ymd/_ONE_HOUR; |
Uint32 hour_num = (Uint32)(after_ymd/_ONE_HOUR); |
Uint32 after_ymdh = after_ymd%_ONE_HOUR; |
Uint32 after_ymdh = (Uint32)(after_ymd%_ONE_HOUR); |
| |
Uint32 min_num = after_ymdh/_ONE_MINUTE; | Uint32 min_num = after_ymdh/_ONE_MINUTE; |
Uint32 after_ymdhm = after_ymdh%_ONE_MINUTE; | Uint32 after_ymdhm = after_ymdh%_ONE_MINUTE; |
|
|
return false; // seconds field has both wildcards and digits | return false; // seconds field has both wildcards and digits |
} | } |
| |
|
|
else if (ans == ONLY_DIGITS) { // minutes field has only digits | else if (ans == ONLY_DIGITS) { // minutes field has only digits |
long seconds = atoi(buffer.getCString()); | long seconds = atoi(buffer.getCString()); |
if (seconds > 59){ | if (seconds > 59){ |
|
|
| |
Uint64 un_normNum = this->_toMicroSeconds(); | Uint64 un_normNum = this->_toMicroSeconds(); |
| |
Uint32 unnor = un_normNum/PEGASUS_UINT64_LITERAL(1000000000); |
// Uint32 unnor = un_normNum/PEGASUS_UINT64_LITERAL(1000000000); |
Uint32 runnor = un_normNum%PEGASUS_UINT64_LITERAL(1000000000); |
// Uint32 runnor = un_normNum%PEGASUS_UINT64_LITERAL(1000000000); |
| |
// get UTC offSet and change it in microseconds | // get UTC offSet and change it in microseconds |
String utcOS = _rep->utcOffSet.subString(1,3); | String utcOS = _rep->utcOffSet.subString(1,3); |
|
|
if ( sign == '-' ) { | if ( sign == '-' ) { |
if (_TEN_THOUSAND_YEARS < (un_normNum + (offSet_hor + offSet_min))){ | if (_TEN_THOUSAND_YEARS < (un_normNum + (offSet_hor + offSet_min))){ |
cout << " this is value " << this->toString() << endl; | cout << " this is value " << this->toString() << endl; |
cout << "number back form: " << unnor << " rema: " << runnor << endl; |
|
throw DateTimeOutOfRangeException(parmsOv); | throw DateTimeOutOfRangeException(parmsOv); |
} | } |
normNum = un_normNum + (offSet_hor + offSet_min); | normNum = un_normNum + (offSet_hor + offSet_min); |