On 21-Nov-2011 15:07 , James Lampert wrote:
Would anybody happen to know how to get the current system time as
the "number of seconds since January 1, 1970 00:00:00 GMT"? Other
than by adjusting a current timestamp to GMT, constructing one for
January 1, 1970 00:00:00, and doing an RPG SUBDUR? Or is that
actually the easiest way?


If a "timeval structure" is desired or "easy" enough, then perhaps:

_gettimeofday()--Get Current UTC Time_
http://publib.boulder.ibm.com/infocenter/iseries/v7r1m0/topic/apis/gettod.htm
"Syntax

#include <sys/time.h>

int gettimeofday (struct timeval *tp,
struct timezone *tzp);

Service Program Name:QWCTZUTC

...

Parameters

tp
(Output) A pointer to a timeval structure that contains the time in seconds and microseconds since 1 January 1970, 00:00:00 UTC (epoch-1970).
"

Regards, Chuck

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.