mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Add a Timespec constructor for the current clock time.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@20293 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
@@ -1535,6 +1535,15 @@ timespecFromTime_t( Timespec *ts, time_t t )
|
||||
ts->tv_nsec = 0;
|
||||
}
|
||||
|
||||
Timespec
|
||||
timespec_now()
|
||||
{
|
||||
Timespec ts;
|
||||
ts.tv_sec = time(NULL);
|
||||
ts.tv_nsec = 0;
|
||||
return ts;
|
||||
}
|
||||
|
||||
time_t
|
||||
timespecToTime_t (Timespec ts)
|
||||
{
|
||||
|
||||
@@ -212,6 +212,9 @@ Timespec timespec_abs(const Timespec *t);
|
||||
* the timepair representing midday on that day */
|
||||
Timespec timespecCanonicalDayTime(Timespec t);
|
||||
|
||||
/** Returns the current clock time as a Timespec, taken from time(2). */
|
||||
Timespec timespec_now (void);
|
||||
|
||||
/** Turns a time_t into a Timespec */
|
||||
void timespecFromTime_t( Timespec *ts, time_t t );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user