|
Hello, Using the API is a bit of overkill in most situations. Doing the Time opcode into a timestamp field gives you everything but the last 3 digits of the timestamp... Which I believe to be the same result as the API. Using a logical file with the time stamp omitted is the only way I know of to actually get the last three digits of the timestamp... Even if a person were able to get the last three digits of a timestamp there will come a day when more than one record will be able to be added in that interval (Trust me it will especially if you rely on a timestamp to be your unique key). There has been discussion on the validity of using timestamps and methods of retrieving them recently and should be accessible via the search facilities. A approach that may be more viable is to use a UUID as has also been discussed recently. The value is not pretty to the eyes, but unique keys should not have any embedded meaning (other than to uniquely identify a record) in my opinion. Wednesday, November 22, 2000, 12:43:38 AM, you wrote: > Hi, > as far as I know there are 2 ways : 1 with an API (see below) the other > is via a logical file where the timestamp field is omitted. As far as I > remember the system sets the timestamp with full precision. > HTH R. > * ----- ---------- API error > structure > d APIError DS 114 > d APIErrSiz 1 4B 0 inz(100) > d APIErrLen 5 8B 0 INZ(0) > d APIErrMsg 9 15 > * ----- ---------- Work > fields > d InpFormat s 10 inz('*CURRENT') > d InpTime s 16 inz(*ZEROS) > D OutFormat s 10 INZ('*YMD') > * -------------- Call API to get current timestamp, including > milliseconds > C call 'QWCCVTDT' > C parm InpFormat > C parm InpTime > C parm OutFormat > C parm CurrDatTim > C parm APIError > * ----- ---------- Convert to *ISO timestamp > format > C eval TstpYear = CurrYear + 1900 > C eval TstpMonth = CurrMonth > C eval TstpDay = CurrDay > C eval TstpHour = CurrHour > C eval TstpMinute = CurrMinute > C eval TstpSecond = CurrSecond > C eval TstpMilli = CurrMilli > Dipl.Inf.(FH) Rolf P Mittag > IBM Partner In Development > Leipziger Str. 50 > D-69214 Eppelheim > eMl: rm@r-m-e-d-v.de > Fon: +49 (6221) 76 78 60 > Fax: +49 (6221) 76 80 26 > +--- > | This is the RPG/400 Mailing List! > | To submit a new message, send your mail to RPG400-L@midrange.com. > | To subscribe to this list send email to RPG400-L-SUB@midrange.com. > | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. > | Questions should be directed to the list owner/operator: david@midrange.com > +--- ---------------------------------- Eric N. Wilson President Doulos Software and Computer Services +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.