× 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 Fri, 2004-04-23 at 17:27, Hatzenbeler, Tim wrote:
>       When I do a timestamp operation I get a field like this...
>       2004-04-23-08.41.56.119000
> 
>       Is there ay way to get values in the smallest three places?  I
> remember a C function that Scott posted, but I can't seem to find it in the
> archive...

There are two ways that immediately come to mind:

1. Convert the timestamp to a string (26a) and substring out the last
three:

d myString                 s                            26a
d mySmallString       s                              3a

 /free
     myString = %char( %timestamp() );
     mySmallString = %subst( myString : 24 );
  /end-free

2.  Retrieve the *microseconds time element and divide by 1000:

d micros                      s                               6s 0
d subMicros                s                               3s 0

 /free
     micros = %subdt( %timestamp() : *ms );
     subMicros = %div( micros : 1000 );
 /end-free

If there is a specific C function I'm not aware of it...

Joel
http://www.rpgnext.com



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.