1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827
|
/* $Id: xdate.cpp,v 1.7 2000/11/10 19:04:17 dbryson Exp $
Xbase project source code
These functions are used for processing dates.
All functions assume a standard date format of CCYYMMDD
for Century,Year,Month and Day
Copyright (C) 1997 StarTech, Gary A. Kunkel
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Contact:
Mail:
Technology Associates, Inc.
XBase Project
1455 Deming Way #11
Sparks, NV 89434
USA
Email:
xbase@techass.com
See our website at:
xdb.sourceforge.net
V 1.0 10/10/97 - Initial release of software
V 1.2 11/30/97 - Updated leap-year processing logic
V 1.5 1/2/98 - Added memo field support
V 1.6a 4/1/98 - Added expression support
V 1.6b 4/8/98 - Numeric index keys
V 1.7.1 5/25/98 - Enhancements/bug fixes from eljorgo@fontun.com
V 1.8.0.a 1/27/99 - Added default date format processing
V 1.9 6/29/99 - CPP ified, minor bug fixes
*/
#ifdef __GNUG__
#pragma implementation "xdate.h"
#endif
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#ifdef __WIN32__
#include <xbase/xbconfigw32.h>
#else
#include <xbase/xbconfig.h>
#endif
#include <xbase/xbase.h>
#include <xbase/xdate.h>
#include <xbase/retcodes.h>
/*! \file xdate.cpp
*/
int xbDate::DaysInMonths[2][13];
int xbDate::AggregatedDaysInMonths[2][13];
const xbString *xbDate::Days[7];
const xbString *xbDate::Months[12];
#define EPOCH_MIN 100
#define EPOCH_MAX 3000
#define DAYS_AD(year) ((year) *365L + (year) / 4 - (year) / 100 + (year) / 400)
/***************************************************************/
//! Short description.
/*!
\param Date8
*/
xbDate::xbDate( const xbString & Date8 ) {
if( DateIsValid( Date8 ))
cDate8 = Date8;
else
Sysdate();
SetDateTables();
}
/***************************************************************/
//! Short description.
/*!
\param Date8
*/
xbDate::xbDate( const char * Date8 ) {
if( DateIsValid( Date8 ))
cDate8 = Date8;
else
Sysdate(); /* if invalid date, set class to sysdate */
SetDateTables();
}
/***************************************************************/
//! Short description.
/*!
*/
xbDate::xbDate()
{
Sysdate();
SetDateTables();
}
/***************************************************************/
//! Short description.
/*!
*/
void xbDate::SetDateTables() {
if( AggregatedDaysInMonths[1][12] != 366 ){ /* first time called ? */
AggregatedDaysInMonths[0][0] = 0;
AggregatedDaysInMonths[0][1] = 31;
AggregatedDaysInMonths[0][2] = 59;
AggregatedDaysInMonths[0][3] = 90;
AggregatedDaysInMonths[0][4] = 120;
AggregatedDaysInMonths[0][5] = 151;
AggregatedDaysInMonths[0][6] = 181;
AggregatedDaysInMonths[0][7] = 212;
AggregatedDaysInMonths[0][8] = 243;
AggregatedDaysInMonths[0][9] = 273;
AggregatedDaysInMonths[0][10] = 304;
AggregatedDaysInMonths[0][11] = 334;
AggregatedDaysInMonths[0][12] = 365;
AggregatedDaysInMonths[1][0] = 0;
AggregatedDaysInMonths[1][1] = 31;
AggregatedDaysInMonths[1][2] = 60;
AggregatedDaysInMonths[1][3] = 91;
AggregatedDaysInMonths[1][4] = 121;
AggregatedDaysInMonths[1][5] = 152;
AggregatedDaysInMonths[1][6] = 182;
AggregatedDaysInMonths[1][7] = 213;
AggregatedDaysInMonths[1][8] = 244;
AggregatedDaysInMonths[1][9] = 274;
AggregatedDaysInMonths[1][10] = 305;
AggregatedDaysInMonths[1][11] = 335;
AggregatedDaysInMonths[1][12] = 366;
DaysInMonths[0][0] = 0;
DaysInMonths[0][1] = 31;
DaysInMonths[0][2] = 28;
DaysInMonths[0][3] = 31;
DaysInMonths[0][4] = 30;
DaysInMonths[0][5] = 31;
DaysInMonths[0][6] = 30;
DaysInMonths[0][7] = 31;
DaysInMonths[0][8] = 31;
DaysInMonths[0][9] = 30;
DaysInMonths[0][10] = 31;
DaysInMonths[0][11] = 30;
DaysInMonths[0][12] = 31;
DaysInMonths[1][0] = 0;
DaysInMonths[1][1] = 31;
DaysInMonths[1][2] = 29;
DaysInMonths[1][3] = 31;
DaysInMonths[1][4] = 30;
DaysInMonths[1][5] = 31;
DaysInMonths[1][6] = 30;
DaysInMonths[1][7] = 31;
DaysInMonths[1][8] = 31;
DaysInMonths[1][9] = 30;
DaysInMonths[1][10] = 31;
DaysInMonths[1][11] = 30;
DaysInMonths[1][12] = 31;
/*
per Rene de Zwart <renez@lightcon.xs4all.nl>
The following assignments of Days[] and Months[] should be accessable
by getting the locale and with it all the language dependencies like months
days and abbreviations, printing the date should lookup the locale.
However, I didn't know how to do this and didn't (yet) find any documentation
on how to do this...
This should work for unices, ms dos/win, os390 (is this unix?) and VAX.
those are the platforms that xbase is being used on.
If you know how, please let me know how - or make the changes to this code
and send it to me..
Gary - gkunkelstartech.keller.tx.us
*/
#ifdef XB_CASTELLANO
Days[0] = new const xbString( "Domingo" );
Days[1] = new const xbString( "Lunes" );
Days[2] = new const xbString( "Martes" );
Days[3] = new const xbString( "Miercoles" );
Days[4] = new const xbString( "Jueves" );
Days[5] = new const xbString( "Viernes" );
Days[6] = new const xbStirng( "Sabado" );
Months[0] = new const xbString( "Enero" );
Months[1] = new const xbString( "Febrero" );
Months[2] = new const xbString( "Marzo" );
Months[3] = new const xbString( "Abril" );
Months[4] = new const xbString( "Mayo" );
Months[5] = new const xbString( "Junio" );
Months[6] = new const xbString( "Julio" );
Months[7] = new const xbString( "Agosto" );
Months[8] = new const xbString( "Septiembre" );
Months[9] = new const xbString( "Octubre" );
Months[10] = new const xbString( "Noviembre" );
Months[11] = new const xbString( "Diciembre" );
#else
Days[0] = new const xbString( "Sunday" );
Days[1] = new const xbString( "Monday" );
Days[2] = new const xbString( "Tuesday" );
Days[3] = new const xbString( "Wednesday" );
Days[4] = new const xbString( "Thursday" );
Days[5] = new const xbString( "Friday" );
Days[6] = new const xbString( "Saturday" );
Months[0] = new const xbString( "January" );
Months[1] = new const xbString( "February" );
Months[2] = new const xbString( "March" );
Months[3] = new const xbString( "April" );
Months[4] = new const xbString( "May" );
Months[5] = new const xbString( "June" );
Months[6] = new const xbString( "July" );
Months[7] = new const xbString( "August" );
Months[8] = new const xbString( "September" );
Months[9] = new const xbString( "October" );
Months[10] = new const xbString( "November" );
Months[11] = new const xbString( "December" );
#endif
}
}
/***************************************************************/
//! Short description.
/*!
\param Date8
*/
/* this function returns century and year from a CCYYMMDD date */
int xbDate::YearOf( const char * Date8 ) const
{
char year[5];
year[0] = Date8[0];
year[1] = Date8[1];
year[2] = Date8[2];
year[3] = Date8[3];
year[4] = 0x00;
return( atoi( year ));
}
/***************************************************************/
//! Short description.
/*!
\param Date8
*/
/* this function returns the month from a CCYYMMDD date */
int xbDate::MonthOf( const char * Date8 ) const
{
char month[3];
month[0] = Date8[4];
month[1] = Date8[5];
month[2] = 0x00;
return( atoi( month ));
}
/***************************************************************/
//! Short description.
/*!
\param Date8
*/
/* this function returns TRUE if a CCYYMMDD date is a leap year*/
int xbDate::IsLeapYear( const char * Date8 ) const
{
int year;
year = YearOf( Date8 );
if(( year % 4 == 0 && year % 100 != 0 ) || year % 400 == 0 )
return 1;
else
return 0;
}
/***************************************************************/
//! Short description.
/*!
\param Format
\param Date8
*/
/* this function returns the "day of" from a CCYYMMDD date */
/* format = XB_FMT_WEEK Number of day in WEEK 0-6 ( Sun - Sat )
format = XB_FMT_MONTH Number of day in MONTH 1-31
format = XB_FMT_YEAR Number of day in YEAR 1-366
*/
int xbDate::DayOf( int Format, const char * Date8 ) const
{
char day[3];
int iday, imonth, iyear, iday2;
/* check for valid format switch */
if( Format!=XB_FMT_WEEK && Format!=XB_FMT_MONTH && Format!=XB_FMT_YEAR )
return XB_INVALID_OPTION;
if( Format == XB_FMT_WEEK )
{
iday = DayOf( XB_FMT_MONTH, Date8 );
imonth = MonthOf( Date8 );
iyear = YearOf ( Date8 );
/* The following formula uses Zeller's Congruence to determine
the day of the week */
if( imonth > 2 ) /* init to February */
imonth -= 2;
else
{
imonth += 10;
iyear--;
}
iday2 = ((13 * imonth - 1) / 5) +iday + ( iyear % 100 ) +
(( iyear % 100 ) / 4) + ((iyear /100 ) / 4 ) - 2 *
( iyear / 100 ) + 77 ;
return( iday2 - 7 * ( iday2 / 7 ));
}
else if( Format == XB_FMT_MONTH )
{
day[0] = Date8[6];
day[1] = Date8[7];
day[2] = 0x00;
return( atoi( day ));
}
else
return(
AggregatedDaysInMonths[IsLeapYear(Date8)][MonthOf(Date8)-1]+
DayOf(XB_FMT_MONTH, Date8));
}
/**********************************************************************/
//! Short description.
/*!
*/
/* this method sets the class date & returns a pointer to system date */
xbString& xbDate::Sysdate()
{
char dt[9];
time_t timer;
struct tm *tblock;
timer = time( NULL );
tblock = localtime( &timer );
tblock->tm_year += 1900;
tblock->tm_mon++;
sprintf( dt,"%4d%02d%02d",tblock->tm_year,tblock->tm_mon,tblock->tm_mday );
dt[8] = 0x00;
cDate8 = dt;
return cDate8;
}
/***************************************************************/
//! Short description.
/*!
\param Date8
*/
/* this function checks a date for validity - returns 1 if OK */
int xbDate::DateIsValid( const char * Date8 ) const
{
int year, month, day;
if(!isdigit( Date8[0] ) || !isdigit( Date8[1] ) || !isdigit( Date8[2] ) ||
!isdigit( Date8[3] ) || !isdigit( Date8[4] ) || !isdigit( Date8[5] ) ||
!isdigit( Date8[6] ) || !isdigit( Date8[7] ) )
return 0;
year = YearOf ( Date8 );
month = MonthOf( Date8 );
day = DayOf ( XB_FMT_MONTH, Date8 );
/* check the basics */
if( year == 0 || month < 1 || month > 12 || day < 1 || day > 31 )
return 0;
/* April, June, September and November have 30 days */
if(( month==4 || month==6 || month==9 || month==11 )&& day > 30 )
return 0;
/* check for February with leap year */
if( month == 2 )
if( IsLeapYear( Date8 ))
{
if( day > 29 )
return 0;
}
else
{
if( day > 28 )
return 0;
}
return 1;
}
/***************************************************************/
//! Short description.
/*!
\param Date8
*/
int xbDate::SetDate( const char * Date8 )
{
if( DateIsValid( Date8 ))
{
cDate8 = Date8;
return 1;
}
return 0;
}
/***************************************************************/
//! Short description.
/*!
\param Date8
*/
/* this returns the number of days since 1/1/1900 */
long xbDate::JulianDays( const char * Date8 ) const
{
int year = YearOf( Date8 );
if(( year < EPOCH_MIN ) || (year >= EPOCH_MAX))
return XB_INVALID_DATE;
/*
long days = DAYS_AD(year) - DAYS_AD(EPOCH_MIN);
*/
long days = 0;
for (long y = EPOCH_MIN; y < year; y++ )
days += 365 + ( ( ( y%4==0 && y%100!=0 ) || y%400==0 ) ? 1 : 0 );
days += (long) DayOf( XB_FMT_YEAR, Date8 ) -1;
return days;
}
/***************************************************************/
//! Short description.
/*!
\param days
*/
/* this function does the opposite of the JulianDays function */
/* it converts a julian based date into a Date8 format */
xbString& xbDate::JulToDate8( long days )
{
char Date8[9];
int year, leap, month;
year = EPOCH_MIN;
leap = 0; /* EPOCH_MIN of 100 is not a leap year */
/* this while loop calculates the year of the date by incrementing
the years counter as it decrements the days counter */
while( days > ( 364+leap ))
{
days -= 365+leap;
year++;
if(( year % 4 == 0 && year % 100 != 0 ) || year % 400 == 0 )
leap = 1;
else
leap = 0;
}
/*
for( i = 12, month = 0; i >= 1 && month == 0; i-- )
{
if( leap && days >= (long) AggregatedDaysInMonths[1][i] )
{
month = i;
days -= AggregatedDaysInMonths[1][i]-1;
}
else if( !leap && days >= (long) AggregatedDaysInMonths[0][i] )
{
month = i;
days -= AggregatedDaysInMonths[0][i]-1;
}
}
sprintf( Date8, "%4d%02d%02ld", year, month, days );
*/
/* this for loop calculates the month and day of the date by
comparing the number of days remaining to one of the tables */
for( month = 12; month >= 1; month-- )
if( days >= (long)AggregatedDaysInMonths[leap][month] ) {
days -= AggregatedDaysInMonths[leap][month];
break;
}
sprintf( Date8, "%4d%02d%02ld", year, month+1, days+1 );
Date8[8] = 0x00;
cDate8 = Date8;
return cDate8;
}
/***************************************************************/
//! Short description.
/*!
\param Date8
*/
/* this routine returns a pointer to the day of the week(Sun-Sat)*/
xbString& xbDate::CharDayOf( const char * Date8 )
{
fDate = strdup( *Days[DayOf(XB_FMT_WEEK, Date8)]);
return fDate;
}
/***************************************************************/
//! Short description.
/*!
\param Date8
*/
/* this routine returns a pointer to the month */
xbString& xbDate::CharMonthOf( const char * Date8 )
{
fDate = strdup( *Months[MonthOf( Date8 )-1]);
return( fDate );
}
/***************************************************************/
//! Short description.
/*!
\param Format
\param Date8
*/
/* This function formats a date and returns a pointer to a */
/* static buffer containing the date */
xbString& xbDate::FormatDate( const char * Format, const char * Date8 )
{
const char *FmtPtr; /* format pointer */
char *BufPtr; /* buffer pointer */
char type;
char cbuf[10];
int type_ctr, i;
char buf[50];
xbString s;
memset( buf, 0x00, 50 );
if( strstr( Format, "YYDDD" ))
{
buf[0] = Date8[2];
buf[1] = Date8[3];
sprintf( buf+2, "%03d", DayOf( XB_FMT_YEAR, Date8 ));
}
else
{
BufPtr = buf;
FmtPtr = Format;
memset( cbuf, 0x00, 10 );
while( *FmtPtr )
{
if( *FmtPtr != 'D' && *FmtPtr != 'M' && *FmtPtr != 'Y' )
{
*BufPtr = *FmtPtr;
BufPtr++;
FmtPtr++;
}
else
{
type = *FmtPtr;
type_ctr = 0;
while( *FmtPtr == type )
{
type_ctr++;
FmtPtr++;
}
switch( type )
{
case 'D':
if( type_ctr == 1 )
{
sprintf( cbuf, "%d", DayOf( XB_FMT_MONTH, Date8 ));
strcat( buf, cbuf );
BufPtr += strlen( cbuf );
}
else if( type_ctr == 2 )
{
cbuf[0] = Date8[6];
cbuf[1] = Date8[7];
cbuf[2] = 0x00;
strcat( buf, cbuf );
BufPtr += 2;
}
else
{
s = CharDayOf( Date8 );
if( type_ctr == 3 )
{
strncat( buf, s.getData(), 3 );
BufPtr += 3;
}
else
{
strcpy( cbuf, CharDayOf( Date8 ));
for( i = 0; i < 9; i++ )
if( cbuf[i] == 0x20 ) cbuf[i] = 0x00;
strcat( buf, cbuf );
BufPtr += strlen( cbuf );
}
}
break;
case 'M':
if( type_ctr == 1 )
{
sprintf( cbuf, "%d", MonthOf( Date8 ));
strcat( buf, cbuf );
BufPtr += strlen( cbuf );
}
else if( type_ctr == 2 )
{
cbuf[0] = Date8[4];
cbuf[1] = Date8[5];
cbuf[2] = 0x00;
strcat( buf, cbuf );
BufPtr += 2;
}
else
{
s = CharMonthOf( Date8 );
if( type_ctr == 3 )
{
strncat( buf, s.getData(), 3 );
BufPtr += 3;
}
else
{
strcpy( cbuf, CharMonthOf( Date8 ));
for( i = 0; i < 9; i++ )
if( cbuf[i] == 0x20 ) cbuf[i] = 0x00;
strcat( buf, cbuf );
BufPtr += strlen( cbuf );
}
}
break;
case 'Y':
if( type_ctr == 2 )
{
cbuf[0] = Date8[2];
cbuf[1] = Date8[3];
cbuf[2] = 0x00;
strcat( buf, cbuf );
BufPtr += 2;
}
else if( type_ctr == 4 )
{
cbuf[0] = Date8[0];
cbuf[1] = Date8[1];
cbuf[2] = Date8[2];
cbuf[3] = Date8[3];
cbuf[4] = 0x00;
strcat( buf, cbuf );
BufPtr += 4;
}
break;
default:
break;
}
}
}
}
fDate = buf;
return fDate;
}
/***************************************************************/
//! Short description.
/*!
\param Date8
*/
/* this routine returns the Date8 format of the last day of the
month for the given input Date8 */
xbString & xbDate::LastDayOfMonth( const char * Date8 )
{
char tmp[9];
sprintf( tmp, "%4.4d%2.2d%2.2d",
YearOf( Date8 ), MonthOf( Date8 ),
DaysInMonths[IsLeapYear(Date8)][MonthOf(Date8)]);
cDate8 = tmp;
return cDate8;
}
/**********************************************************************/
//! Short description.
/*!
*/
xbString &xbDate::operator+=( int count )
{
JulToDate8( JulianDays() + count );
return cDate8;
}
/**********************************************************************/
//! Short description.
/*!
*/
xbString &xbDate::operator-=( int count )
{
JulToDate8( JulianDays() - count );
return cDate8;
}
/**********************************************************************/
//! Short description.
/*!
*/
xbString &xbDate::operator++( int )
{
*this+=1;
return cDate8;
}
/**********************************************************************/
//! Short description.
/*!
*/
xbString &xbDate::operator--( int )
{
*this-=1;
return cDate8;
}
/**********************************************************************/
//! Short description.
/*!
*/
xbString &xbDate::operator+( int count )
{
xbDate d( GetDate() );
d+=count;
fDate = d.GetDate();
return fDate;
}
/**********************************************************************/
//! Short description.
/*!
*/
xbString &xbDate::operator-( int count )
{
xbDate d( GetDate() );
d-=count;
fDate = d.GetDate();
return fDate;
}
/**********************************************************************/
//! Short description.
/*!
*/
long xbDate::operator-( const xbDate & d ) const
{
return JulianDays() - d.JulianDays();
}
/**********************************************************************/
//! Short description.
/*!
*/
int xbDate::operator==( const xbDate & d ) const
{
if( JulianDays() == d.JulianDays() )
return 1;
else
return 0;
}
/**********************************************************************/
//! Short description.
/*!
*/
int xbDate::operator!=( const xbDate & d ) const
{
if( JulianDays() != d.JulianDays() )
return 1;
else
return 0;
}
/**********************************************************************/
//! Short description.
/*!
*/
int xbDate::operator<( const xbDate & d ) const
{
if( JulianDays() < d.JulianDays() )
return 1;
else
return 0;
}
/**********************************************************************/
//! Short description.
/*!
*/
int xbDate::operator>( const xbDate & d ) const
{
if( JulianDays() > d.JulianDays() )
return 1;
else
return 0;
}
/**********************************************************************/
//! Short description.
/*!
*/
int xbDate::operator<=( const xbDate & d ) const
{
if( JulianDays() <= d.JulianDays() )
return 1;
else
return 0;
}
/**********************************************************************/
//! Short description.
/*!
*/
int xbDate::operator>=( const xbDate & d ) const
{
if( JulianDays() >= d.JulianDays() )
return 1;
else
return 0;
}
/**********************************************************************/
|