### Tgettimeofday()

LONG Tgettimeofday( tv, tzp)

timeval *tv;
timezone *tzp;

| Tgettimeofday() interrogates the state of the internal, high resolution system clock.
Opcode | 341 (0x0155)
Availability | Available when a MiNT kernel of a version at least 1.15.0 release is detected.
Parameters | The argument tv is a pointer to the following structure:
    struct timeval
    {
    	long int tv_sec;
    	long int tv_usec;
    };
tv_sec holds the number of seconds elapsed since the epoch. The epoch is Thu, Jan 1 1970 00:00:00 UTC. tv_usec holds the fractional part of tv_sec measured in microseconds. The argument tzp is a pointer to another structure:
    struct timezone
    {
    	long int tz_minuteswest;
    	long int tz_dsttime;
    };
tz_minuteswest holds the offset to UTC in seconds. Timezones east of the zero-meridian (e.g. Eastern Europe) have a negative offset, timezones west of the zero-meridian (e.g. America) have a positive one. tz_dsttime is non-zero, if daylight savings time applies during some part of the year. You may safely pass NULL for either argument. This isn't considered an error.
Return value | The function can never fail. It always returns E_OK.
Binding |
    pea	tzp
    pea	tv
    move.w  #$0155,-(sp)
    trap    #1
    lea     $0a(sp),sp
Caveats | Implementors of library bindings should be aware that the definition of struct timezone is non-standard. The members are actually int and not long int (this applies only to struct timezone; the members of struct timeval are always long). 16-bit libraries will have to copy the contents of the structure that tzp points to.
Comments | The Ssystem() call has a command S_CLOCKMODE. This command allows to retrieve or set the kernel clock mode, i.e. to specify whether the hardware clock is meant to run in UTC or in local time. It is planned to make MiNT compliant with the kernel time keeping model described in RFC1305. This model is already successfully implemented in operating systems such as SunOS, Ultrix, OSF/1, HP-UX and Linux. Please expect the internal realization to change in the future.
See also | Ssystem(), Tsettimeofday()