|
Hello List,
I have a complicated date conversion I am trying to accomplish. Here is the situation, with some example data. I've just not been able to figure out how to handle this so hopefully someone can assist.
I am receiving from an ERP system a hex value for a Julian date. This is a real Julian date, not a JDE type of date. Ultimately I need to convert this to YYYYMMDD format.
The hex is just simple text like this: 257D96
This hex should convert to a decimal value of: 2456982
When putting in this value on a Julian date conversion page, I get this as the date: 11/20/2014
This all works awesome when I do it by hand using Notepad++ and a web page :)
Problem is, I can't seem to figure out how to do the same in RPG.
I was able to use 'cvtch' to get my text representation of the hex number converted in to real hex. But, I've tried the overlay method of getting the decimal equivalent of the hex number and that has not worked.
To be honest though, I am not sure what the exact best approach here should be anyway. So, rather than maybe explain how I would try and do this or think I should, I'll ask the group and see what you all think.
Thanks in advance for any advice. It is appreciated.
Brian
--
This is the RPG programming on the IBM i (AS/400 and 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.