See ChangeLog entry 19990524-19:20 EST David G. Holm <dholm@jsd-llc.com>

This commit is contained in:
David G. Holm
1999-05-25 02:26:51 +00:00
parent 22e507b46c
commit db5fefce1f
3 changed files with 30 additions and 1 deletions

View File

@@ -1,3 +1,9 @@
19990524-19:20 EST David G. Holm <dholm@jsd-llc.com>
* source/rtl/dates.c
- Added HARBOUR DATE() function.
* tests/working/dates.prg
- Added use of DATE() function in first OUTSTD call.
19990524-21:05 CET Eddie Runia
* source/rtl/strings.c
PAD* didn't work correctly with negative numbers

View File

@@ -425,3 +425,26 @@ oTime->tm_sec);
}
}
HARBOUR DATE( void )
{
if( _pcount() == 0 )
{
time_t t;
struct tm *oTime;
char szTime[9];
time(&t);
oTime = localtime(&t);
sprintf(szTime, "%04d%02d%02d", oTime->tm_year, oTime->tm_mon + 1,
oTime->tm_mday);
_retds(szTime);
}
else
{
/* QUESTION: Clipper catches this at compile time! */
PITEM pError = _errNew();
_errPutDescription(pError, "Incorrect number of arguments: DATE");
_errLaunch(pError);
_errRelease(pError);
}
}

View File

@@ -7,7 +7,7 @@ local cNewLine := CHR( 10 )
local dDate, dDate2, cMask, cDate
OUTSTD (cNewLine, "Testing Harbour dates management", cNewLine)
OUTSTD (cNewLine, "Testing Harbour dates management on", DATE(), cNewLine)
OUTSTD (cNewLine, HB_SETCENTURY ())
HB_SETCENTURY ("ON")