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



Nice - you could also use the *DOS output type and have a data structure in RPG for the integer values - you get hundredths of seconds and even day of week. Or in recent CL, you could use based integer variables over the output.

Vern

On 2/23/2011 2:44 PM, Marvin Radding wrote:
Thanks to all who helped with this problem, especially to Crispin Bates
who provided a link that I used.

It worked the first time. Surprise! Surprise!

Here is my code sample for future reference:

*-----------------------------------------------------------------------
----
d convert_machine_timestamp...

d pr extpgm('QWCCVTDT')

d input_format 10a

d machine_timestamp...

d 20u 0

d output_format 10a

d output_variable...

d 20a

d

d error like(api_error)


*-----------------------------------------------------------------------
---
D unformatted_timestamp...
D 20u 0
d input_format s 10a inz('*DTS')
d output_format...
d s 10a inz('*YYMD')
d journal_timestamp...
d s 20a inz(*blank)
d stamptime s 26a
/free
convert_machine_timestamp(Input_format
:unformatted_timestamp
:output_format
:journal_timestamp
:api_error);
if api_error.bytes_available> *zero;
stamptime = %char(%timestamp());
else;
stamptime = %subst(journal_timestamp:1:4) + '-'
+ %subst(journal_timestamp:5:2) + '-'
+ %subst(journal_timestamp:7:2) + '-'
+ %subst(journal_timestamp:9:2) + '.'
+ %subst(journal_timestamp:11:2) + '.'
+ %subst(journal_timestamp:13:2) + '.'
+ %subst(journal_timestamp:15:4);
endif;
/end-free

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.