idate handling changes

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@796 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Linas Vepstas 1998-04-08 06:35:47 +00:00
parent ac894591b3
commit 42dbcd3303
2 changed files with 21 additions and 0 deletions

View File

@ -347,6 +347,26 @@ xaccSetDateCellValue (DateCell *cell, int day, int mon, int year)
/* ================================================ */
void
xaccSetDateCellValueSecs (DateCell *cell, time_t secs)
{
char buff[30];
struct tm * stm;
stm = localtime (&secs);
cell->date = *stm;
printDate (buff, cell->date.tm_mday,
cell->date.tm_mon+1,
cell->date.tm_year+1900);
if (cell->cell.value) free (cell->cell.value);
cell->cell.value = strdup (buff);
}
/* ================================================ */
static void
setDateCellValue (BasicCell *_cell, const char *str)
{

View File

@ -73,6 +73,7 @@ void xaccInitDateCell (DateCell *);
void xaccDestroyDateCell (DateCell *);
void xaccSetDateCellValue (DateCell *, int day, int mon, int year);
void xaccSetDateCellValueSecs (DateCell *, time_t secs);
#endif /* __XACC_DATE_CELL_C__ */