ajtime.c
Datatypes: AjPTime none
Time object
Sections: constructors destructors get time get reference to internals set time comparison debug exit
Functions for constructing time objects.
Functions: ajTimeNew ajTimeNewDayFmt ajTimeNewTime ajTimeNewToday ajTimeNewTodayFmt
Constructor for AjPTime object.
Synopsis
Prototype
AjPTime ajTimeNew (
void
);
Type | Name | Read/Write | Description |
AjPTime | | RETURN | An AjPTime object |
Returns
AjPTime: | An AjPTime object |
Description
Constructor for AjPTime object.
See Also
See other functions in this section
Availability
In release 6.4.0
Constructor for user specification of an arbitrary AjPTime object.
Except for 'timefmt', the arguments are based upon the UNIX
'tm' time structure defined in the time.h header file.
The range validity of numbers given are not checked.
Synopsis
Prototype
AjPTime ajTimeNewDayFmt (
const char* timefmt,
ajint mday,
ajint mon,
ajint year
);
Type | Name | Read/Write | Description |
const char* | timefmt | Input | Time format to use |
ajint | mday | Input | Day of the month [1-31] |
ajint | mon | Input | Month [1-12] |
ajint | year | Input | Four digit year |
AjPTime | | RETURN | An AjPTime object |
Input
timefmt: | (Input) | Time format to use |
mday: | (Input) | Day of the month [1-31] |
mon: | (Input) | Month [1-12] |
year: | (Input) | Four digit year |
Returns
AjPTime: | An AjPTime object |
Description
Constructor for user specification of an arbitrary AjPTime object.
Except for 'timefmt', the arguments are based upon the UNIX
'tm' time structure defined in the time.h header file.
The range validity of numbers given are not checked.
See Also
See other functions in this section
Availability
In release 6.4.0
Constructor for AjPTime object, making a copy of an existing time object
Synopsis
Prototype
AjPTime ajTimeNewTime (
const AjPTime src
);
Type | Name | Read/Write | Description |
const AjPTime | src | Input | Time object to be copied |
AjPTime | | RETURN | An AjPTime object |
Input
src: | (Input) | Time object to be copied |
Returns
AjPTime: | An AjPTime object |
Description
Constructor for AjPTime object, making a copy of an existing time object
See Also
See other functions in this section
Availability
In release 6.4.0
AJAX function to return today's time as an AjPTime object
Synopsis
Prototype
AjPTime ajTimeNewToday (
void
);
Type | Name | Read/Write | Description |
AjPTime | | RETURN | Pointer to time object containing today's date/time |
Returns
AjPTime: | Pointer to time object containing today's date/time |
Description
AJAX function to return today's time as an AjPTime object
See Also
See other functions in this section
Availability
In release 6.4.0
AJAX function to return today's time as an AjPTime object
with a specified output format
Synopsis
Prototype
AjPTime ajTimeNewTodayFmt (
const char* timefmt
);
Type | Name | Read/Write | Description |
const char* | timefmt | Input | A controlled vocabulary of time formats |
AjPTime | | RETURN | Pointer to time object containing today's date/time |
Input
timefmt: | (Input) | A controlled vocabulary of time formats |
Returns
AjPTime: | Pointer to time object containing today's date/time |
Description
AJAX function to return today's time as an AjPTime object
with a specified output format
See Also
See other functions in this section
Availability
In release 6.4.0
Functions for destroying time objects.
Functions: ajTimeDel
Destructor for AjPTime object.
Synopsis
Prototype
void ajTimeDel (
AjPTime* Ptime
);
Type | Name | Read/Write | Description |
AjPTime* | Ptime | Output | Time object pointer |
void | | RETURN | |
Output
Ptime: | (Output) | Time object pointer |
Returns
Description
Destructor for AjPTime object.
See Also
See other functions in this section
Availability
In release 6.4.0
Functions for retrieving elements of a time object
Functions: ajTimeGetTimetype
An AjPTime object version of the mktime function that returns
a standard time_t value
Synopsis
Prototype
time_t ajTimeGetTimetype (
const AjPTime thys
);
Type | Name | Read/Write | Description |
const AjPTime | thys | Input | Time object |
time_t | | RETURN | Standard time value |
Input
Returns
time_t: | Standard time value |
Description
An AjPTime object version of the mktime function that returns
a standard time_t value
See Also
See other functions in this section
Availability
In release 6.4.0
Functions for retrieving references to time internals
Functions: ajTimeRefToday ajTimeRefTodayFmt
AJAX function to return today's time as an AjPTime object reference
Synopsis
Prototype
const AjPTime ajTimeRefToday (
void
);
Type | Name | Read/Write | Description |
const AjPTime | | RETURN | Pointer to static time object containing
today's date/time |
Returns
const AjPTime: | Pointer to static time object containing
today's date/time |
Description
AJAX function to return today's time as an AjPTime object reference
See Also
See other functions in this section
Availability
In release 6.4.0
AJAX function to return today's time as a static AjPTime object
with a specified output format
Synopsis
Prototype
const AjPTime ajTimeRefTodayFmt (
const char* timefmt
);
Type | Name | Read/Write | Description |
const char* | timefmt | Input | A controlled vocabulary of time formats |
const AjPTime | | RETURN | Pointer to static time object containing
today's date/time |
Input
timefmt: | (Input) | A controlled vocabulary of time formats |
Returns
const AjPTime: | Pointer to static time object containing
today's date/time |
Description
AJAX function to return today's time as a static AjPTime object
with a specified output format
See Also
See other functions in this section
Availability
In release 6.4.0
Functions for setting the time.
Functions: ajTimeSetC ajTimeSetS ajTimeSetLocal
Constructor for user specification of an AjPTime object.
using the time set as a string in format
yyyy-mm-dd hh:mm:ss
used so that graphs which include the date can remain constant for
documentation and testing.
Synopsis
Prototype
AjBool ajTimeSetC (
AjPTime thys,
const char* timestr
);
Type | Name | Read/Write | Description |
AjPTime | thys | Output | Time object |
const char* | timestr | Input | Time in format yyyy-mm-dd hh:mm:ss |
AjBool | | RETURN | ajTrue on success |
Input
timestr: | (Input) | Time in format yyyy-mm-dd hh:mm:ss |
Output
Returns
Description
Constructor for user specification of an AjPTime object.
using the time set as a string in format
yyyy-mm-dd hh:mm:ss
used so that graphs which include the date can remain constant for
documentation and testing.
See Also
See other functions in this section
Availability
In release 6.4.0
Constructor for user specification of an AjPTime object.
using the time set as a string in format
yyyy-mm-dd hh:mm:ss
used so that graphs which include the date can remain constant for
documentation and testing.
Synopsis
Prototype
AjBool ajTimeSetS (
AjPTime thys,
const AjPStr timestr
);
Type | Name | Read/Write | Description |
AjPTime | thys | Output | Time object |
const AjPStr | timestr | Input | Time in format yyyy-mm-dd hh:mm:ss |
AjBool | | RETURN | ajTrue on success |
Input
timestr: | (Input) | Time in format yyyy-mm-dd hh:mm:ss |
Output
Returns
Description
Constructor for user specification of an AjPTime object.
using the time set as a string in format
yyyy-mm-dd hh:mm:ss
used so that graphs which include the date can remain constant for
documentation and testing.
See Also
See other functions in this section
Availability
In release 6.4.0
A localtime()/localtime_r() replacement for AjPTime objects
Synopsis
Prototype
AjBool ajTimeSetLocal (
AjPTime thys,
const time_t timer
);
Type | Name | Read/Write | Description |
AjPTime | thys | Output | Time object |
const time_t | timer | Input | Populated standard C time structure |
AjBool | | RETURN | true if successful |
Input
timer: | (Input) | Populated standard C time structure |
Output
Returns
AjBool: | true if successful |
Description
A localtime()/localtime_r() replacement for AjPTime objects
See Also
See other functions in this section
Availability
In release 6.4.0
Functions for comparing time objects.
Functions: ajTimeDiff
Difference between two time objects
Synopsis
Prototype
double ajTimeDiff (
const AjPTime thys,
const AjPTime newtime
);
Type | Name | Read/Write | Description |
const AjPTime | thys | Input | Original time object |
const AjPTime | newtime | Input | Later time object |
double | | RETURN | Difference in seconds |
Input
thys: | (Input) | Original time object |
newtime: | (Input) | Later time object |
Returns
double: | Difference in seconds |
Description
Difference between two time objects
See Also
See other functions in this section
Availability
In release 6.4.0
Functions for debugging time objects.
Functions: ajTimeTrace
Debug report on the contents of an AjPTime object
Synopsis
Prototype
void ajTimeTrace (
const AjPTime thys
);
Type | Name | Read/Write | Description |
const AjPTime | thys | Input | Time object |
void | | RETURN | |
Input
Returns
Description
Debug report on the contents of an AjPTime object
See Also
See other functions in this section
Availability
In release 6.4.0
Functions called on exit from the program by ajExit to do
any necessary cleanup and to report internal statistics to the debug file
Functions: ajTimeExit
Cleans up time processing internal memory
Synopsis
Prototype
void ajTimeExit (
void
);
Type | Name | Read/Write | Description |
void | | RETURN | |
Returns
Description
Cleans up time processing internal memory
See Also
See other functions in this section
Availability
In release 6.4.0
time internals
Sections: reset
Functions for memory cleanup
Functions: ajTimeReset
Resets the clock time to zero
Synopsis
Prototype
void ajTimeReset (
void
);
Type | Name | Read/Write | Description |
void | | RETURN | |
Returns
Description
Resets the clock time to zero
See Also
See other functions in this section
Availability
In release 6.4.0
Functions for retrieving CPU time
Functions: ajClockDiff ajClockNow ajClockSeconds
Returns the cpu time in seconds between two clock values
Synopsis
Prototype
double ajClockDiff (
ajlong starttime,
ajlong nowtime
);
Type | Name | Read/Write | Description |
ajlong | starttime | Input | start time |
ajlong | nowtime | Input | current time |
double | | RETURN | Total cpu clock time in seconds |
Input
starttime: | (Input) | start time |
nowtime: | (Input) | current time |
Returns
double: | Total cpu clock time in seconds |
Description
Returns the cpu time in seconds between two clock values
See Also
See other functions in this section
Availability
In release 6.4.0
Returns the clock time as a long even for systems where the clock_t type
is 4 bytes
Synopsis
Prototype
ajlong ajClockNow (
void
);
Type | Name | Read/Write | Description |
ajlong | | RETURN | Total clock ticks |
Returns
Description
Returns the clock time as a long even for systems where the clock_t type
is 4 bytes
See Also
See other functions in this section
Availability
In release 6.4.0
Returns the cpu time in seconds since the start
Synopsis
Prototype
double ajClockSeconds (
void
);
Type | Name | Read/Write | Description |
double | | RETURN | Total cpu clock time in seconds |
Returns
double: | Total cpu clock time in seconds |
Description
Returns the cpu time in seconds since the start
See Also
See other functions in this section
Availability
In release 6.4.0
Functions for CPU time memory cleanup
Functions: ajClockReset
Resets the clock time to zero
Synopsis
Prototype
void ajClockReset (
void
);
Type | Name | Read/Write | Description |
void | | RETURN | |
Returns
Description
Resets the clock time to zero
See Also
See other functions in this section
Availability
In release 6.4.0