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



>From what you describe, you're getting an internal machine timestamp in 
what IBM calls "MI_TIME" format.

This is an 8-byte (64-bit) unsigned binary value that counts up from a 
"value such that the high-order bit changes from 0 to 1 as the century 
changes from 1999 to 2000".  Worse, the time incrementation is every 8 
microseconds but not into the lowest bit ( it once was only every 1,024 
microseconds but into a different bit position).  The definition of this 
8-byte area provides for a 143 year time range from (about 1928 through 
the middle of this century).

I have written both ILE RPG  code to use this time format (and change it 
into something human-readable) and a small java class.

The RPG code looks like this:

p CvtMItoISO      b 

 *   Convert _MI_time input to standard timestamp

d CvtMItoISO      pr              z 
d MItime                        20u 0 const 

d CvtMItoISO      pi              z 
d MItime                        20u 0 const 

d HighBitDS       ds 
d                                8a   inz(x'8000000000000000')
d  HighBit                      20u 0 overlay(HighBitDS) 

d ToCvt           s             21p 0 
d Y2K             s               z   inz(z'2000-01-01-00.00.00.000000')
d C4096           s             11p 0 inz(4096000000) 
d ToSub           s             21p 0 
d Seconds         s             15p 0 
d Micros          s             15p 0 
d Result          s               z 

c                   if        MItime < HighBit 
c                   eval      ToCvt = HighBit - MiTime 
c                   else 
c                   eval      ToCvt = MiTime - HighBit 
c                   endif 

c     ToCvt         div       C4096         Seconds 
c     Seconds       mult      C4096         ToSub 
c     ToCvt         sub       ToSub         Micros 
c     Micros        div       4096          Micros 

c                   if        MItime < HighBit 
c     Y2K           subdur    Seconds:*S    Result 
c                   subdur    Micros:*MS    Result 
c                   else 
c     Y2K           adddur    Seconds:*S    Result 
c                   adddur    Micros:*MS    Result 
c                   endif 

c                   return    Result 

p CvtMItoISO      e 

If you want the Java version, please contact me off-list

Dave Schnee (dschnee@xxxxxxxxxxxxxxxxxxx)
Barsa Consulting Group, LLC
Office  Mon, Tues, Thurs
Home    Wed, Fri

----   P.Prasad  wrote  -----

> -----Original Message-----
> From: midrange-l-bounces@xxxxxxxxxxxx
> [mailto:midrange-l-bounces@xxxxxxxxxxxx]On Behalf Of p prasad
> Sent: Thursday, July 21, 2005 6:54 AM
> To: midrange-l@xxxxxxxxxxxx
> Subject: Timestamp
>
>
> Hi,
> I am receiving TIMESTAMP value from the iSeries system as an
> unsigned 64 bit integer value. Is it possible to convert this
> timestamp into a readable format in windows machine? The iSeries
> timestamp value is an unsigned 64 bit integer value. All the time
> management routines which I can use on a windows machine deal
> with signed integer value. So the iSeries timestamp appears as a
> negative value(the MSB is 1 in the iSeries TIMESTAMP) to the
> routines like ctime64() or gmtime64(). Any clues?
>
> P.Prasad
>
>
> ---------------------------------
> How much free photo storage do you get? Store your friends n
> family photos for FREE with Yahoo! Photos.
>  http://in.photos.yahoo.com
> --
> 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 ...


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.