|
John, Thanks for your solution It solved the retrieval of the UTC offset splendidly. I think the gettimeofday needs its timezone values first to be set using the settimeofday. Scott, if you read this, then this might provide you with an update to your IFS tutorial (for which i am most gratefull). Loek. ----- Original Message ----- From: "John Taylor" <lists@xxxxxxxxxxxxxxxxxxxx> To: "'RPG programming on the AS400 / iSeries'" <rpg400-l@xxxxxxxxxxxx> Sent: Thursday, October 30, 2003 1:27 AM Subject: RE: gettimeofday does noet return UTC offset > Loek, > > As James' has already mentioned, this API will not give you the timezone > information. The timezone parameter is obsolete, and does not get > populated. You can use the following code to get the timezone (I'm > assuming you want RPG, since you're on the RPG list!): > > > * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > - - - - - - - - - - - - > * Procedure......: swTmRtnOfs > * Description....: Return the offset from UTC to local time. > * > * > * Parameter Name Type Description > * -------------- ------------ > ----------------------------------------------------- > * Required Group: > * iType char(1) Type of output value required: > * 'H' - hours > * 'M' - minutes > * 'S' - seconds > * > * Returns: > * offset value > * > * Copyright (c) 2002, Studioworks Technology Group Inc. > * All Rights Reserved > * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > - - - - - - - - - - - - > P swTmRtnOfs b export > D pi 8f > D iType 1a const > > *-- define an ILE condition token > DdsCTK ds > D dsCTK_MsgSev 5i 0 > * Message severity > D dsCTK_MsgNo 2a > * Hex representation of message > ID. > D 1a > * Reserved > D dsCTK_MsgPrfx 3a > * Message ID Prefix > D dsCTK_MsgKey 4a > * Message key > > *-- API parameters > d uHours s 10i 0 > d uMinutes s 10i 0 > d uSeconds s 8f > > *-- misc variables > d result s 8f > > *-- call system API for offset value > C callp ceeRtnUtcOfs(uHours: > C uMinutes: > C uSeconds: > C dsCTK) > > *-- when error > C select > C when ( dsCTK_MsgSev > 0 ) > C eval result = *zeros > > *-- when caller wants the hours > C when ( iType = 'H' ) > C eval result = uHours > > *-- when caller wants the minutes > C when ( iType = 'M' ) > C eval result = (uHours * 60 ) > C if ( uHours < 0 ) > C eval result = result + (uMinutes * -1) > C else > C eval result = result + uMinutes > C endif > > *-- when caller wants the seconds > C when ( iType = 'S' ) > C eval result = uSeconds > > *-- otherwise, caller is an idiot > C other > C eval result = *zeros > C endsl > > * return to caller > C return result > > > P swTmRtnOfs e > > > The prototype for CEERTNUTCOFS follows: > > > s* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > - - - - > s* Return the offset from Universal Coordinated to Local Time > s* uHours - Offset expressed in hours > s* uMinutes - Additional minutes from uHours. > s* uSeconds - Offset expressed in seconds > s* uApiErr - 12-byte feedback code > s* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > - - - - > D ceeRtnUTCOfs pr extproc('CEEUTCO') > D uHours 10i 0 > D uMinutes 10i 0 > D uSeconds 8f > D uCeeFbk 12a options(*omit) > > > Hope this helps. > > > John Taylor > > > _______________________________________________ > This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list > To post a message email: RPG400-L@xxxxxxxxxxxx > To subscribe, unsubscribe, or change list options, > visit: http://lists.midrange.com/mailman/listinfo/rpg400-l > or email: RPG400-L-request@xxxxxxxxxxxx > Before posting, please take a moment to review the archives > at http://archive.midrange.com/rpg400-l. >
As an Amazon Associate we earn from qualifying purchases.
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.