mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
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:
parent
ac894591b3
commit
42dbcd3303
@ -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)
|
||||
{
|
||||
|
@ -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__ */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user