× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Building upon Chuck's good suggestion (thanks, Chuck!), I have provided a better procedure for obtaining seconds since 1-Jan-1970, 0:00:00 in either Local or GM time.

If no parameter is passed to the procedure (or if a parameter is passed but it doesn't equal 'L') then GMT time is returned. Otherwise, Local time is returned.

The procedure (along with its test-program wrapper) can be found at http://code.midrange.com/8abba7dbd7.html
++
Dennis
++
"To invent, you need a good imagination and a pile of junk."
-- Thomas Edison



Sent from my Galaxy tablet phone. Please excuse my brevity.
For any grammatic/spelling errors, there is no excuse.
++


"CRPence" <CRPbottle@xxxxxxxxx> wrote:

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
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.