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



Errr...

Scott Klement wrote:
I recently posted an example of doing exactly what you're trying to do.
Here's a link:
http://www.systeminetwork.com/isnetforums/showthread.php?t=49068

Actually that thread is the OPPOSITE of what you wnated to do. Here's code that does what you want to do:

*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
* Convert Unix timestamp to RPG timestamp
*
* Call this with the data returned by stat() or Qp0lGetAttr
* convert to an RPG timestamp field.
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
P Unix2Rpg B
D Unix2Rpg PI Z
D UnixTime 10U 0 value

D CEEUTCO PR
D Hours 10I 0
D Mins 10I 0
D Secs 8F
D fc 12A options(*omit)

D Epoch c z'1970-01-01-00.00.00'
D TimeZone s 10I 0 static inz(-1)
D Hours s 10I 0
D Mins s 10I 0
D Secs s 8F
D retval s Z

/free

if (TimeZone = -1);
CEEUTCO(Hours: Mins: Secs: *omit);
TimeZone = secs;
endif;

retval = Epoch;
retval = retval + %seconds(UnixTime) + %seconds(TimeZone);
return retval;

/end-free
P E


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.