× 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.



On Mon, 27 Sep 2004, Buzz Fenner wrote:

I'm using the SNTP client to access a machine configured as a time server on
our LAN; then I just read Scott Klement's answer to a submitted question in
ClubTech that the time being updated is OS/400's software clock and not the
hardware clock.  He states that QTIME, etc. is tied to the hardware clock.
I was wondering if the TIME opcode used the software or hardware clock.

You can be assured of accessing the software clock if you call the C function gettimeofday(). Using it in RPG is not very easy since gettimeofday() required a pointer to a struct timeval.


You could also call time() and then convert the result to your locale with localtime(). Again, both use C structures that RPG doesn't have. You could create a C module that does it though. Here is some C sample code:

#include <stdio.h>
#include <time.h>

int
main ()
{
  time_t curtime;
  struct tm *date;

  curtime = time (NULL);
  date = localtime (&curtime);
  printf ("The date and time is: "%04d%02d%02d %02d:%02d:%02d\n",
          date->tm_year + 1900, date->tm_mon + 1, date->tm_mday,
          date->tm_hour, date->tm_min, date->tm_sec);
  return 0;
}

James Rich

Vs lbh cynl n Zvpebfsg PQ  onpxjneqf, lbh pna urne fngnavp zrffntrf. Ohg
rira jbefr, vs lbh cynl vg sbejneq, vg vafgnyyf gurve fbsgjner!
        -- Fcbgvphf ba /.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.