|
Hi, but this integer value is only the binary value of the numeric date. The date in a file is stored as the calculated number of days from 0001-01-01. This can be proved by using the SQL scalar function HEX(). Just create a small file with either DDS or SQL: CREATE TABLE HAUSER/MYDATETAB (MYDATE DATE NOT NULL WITH DEFAULT) Insert a few dates, and run the following program: FMyDateTab IF E K DISK Rename(MyDateTab: MyDateTabF) *------------------------------------------------------------------- D DateInt 10I 0 D DateHex 10A *------------------------------------------------------------------- C DOU 0=1 C Read MyDateTabF C If %EOF C leave C EndIf C MyDate Dsply C Eval DateAlpha = %Char(MyDate: *Iso0) C DateAlpha Dsply C Eval DateInt = %Int(%Char(MyDate: *Iso0)) C DateInt Dsply C/EXEC SQL Set :DateHex = Hex(:DateInt) C/End-Exec C DateHex Dsply C/EXEC SQL Set :DateHex = Hex(:MyDate) C/End-Exec C DateHex Dsply C EndDo C Eval *InLR = *On Yet some other thoughts about Julian, Gregorian Calender and Lilan Date. The gregorian calender started with october 15th in 1582. Immediatetly after october 4th followed october 15th in 1582. The days of week were not changed, that means october 4th was a thursday and october 15th was a friday. But the gregorian calender was not introduced in all countries at the same time. First only the catholic countries, Italy, Spain and France were forced to use the Gregorian calender. In Germany the Gregorian calender was introduced in 1700 and in Great Britain and USA after 1770. So you may ask for example if Shakespeares Birthday is his really birthday. Birgitta -----Ursprüngliche Nachricht----- Von: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]Im Auftrag von Tony Carolla Gesendet: Dienstag, 11. Oktober 2005 20:09 An: RPG programming on the AS400 / iSeries Betreff: Re: Date question That's much nicer! Thanks! In fact, that simplifies it so much, I don't really need a service program anymore ;-) (well, actually, modifying the svc program will be easier than to seekand re-compile all the pgms that use it... VBG) On 10/11/05, Scott Klement <rpg400-l@xxxxxxxxxxxxxxxx> wrote: > > > > NumDays=%Int(%Char(DateA:*ISO0)); > > DateB=%Date(NumDays:*ISO); > > Alternately, if you're at V5R3, you could code: > > D DateA s D inz(d'2005-01-01') > D IntDate s 10I 0 > . > . > IntDate = %dec(DateA:*ISO); > DateB = %Date(IntDate:*ISO); > > It's not a big change, but I think it's a little easier to read when there > aren't any nested BIFs. > -- > 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. > > -- "Enter any 11-digit prime number to continue..." "In Hebrew SQL, how do you use right() and left()?..." - Random Thought "If all you have is a hammer, all your problems begin to look like nails" -- 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.