I think I got the following off jdelist in the past. DB2 SQL that demonstrates a lot of ways to do the data conversions, formatting, etc. Reposting it in case I did find it someplace else:
/* Simple method to convert the JDE dates to a readable date. */
select SDTRDJ, date(char(SDTRDJ+1900000)) as FormattedDate
from testdta.f42119
where SDDOCO = 16559822;
/* Example showing ways to deal with date and time */
select sddoco,
sddcto,
sdlnid,
sdupmj,
sdtday,
right('000000'||sdtday,6) as wholetime,
substr(right('000000'||sdtday,6),1,2)||'.'||substr (right('000000'||sdtday,6),3,2)||'.'||substr(right ('000000'||sdtday,6),5,2) as propertime,
sdupmj,
1900000+sdupmj as DB2JULDATE,
date(cast((1900000+sdupmj) as char(7))) as strdate,
timestamp(cast(date(cast((1900000+sdupmj) as char(7))) as char(10))||'-'||cast(substr(right('000000'||sdtday,6),1,2)||'.' ||substr(right('000000'||sdtday,6),3,2)||'.'||substr(right('000000'||sdtday,6),5,2) as char(8))) as DB2TimeStamp,
year(current date) * 1000 + dayofyear(current date) -1900000 as JDEJulianToday,
year(current date - 1 day) * 1000 + dayofyear(current date - 1 day) -1900000 as JDEJulianYesterday,
year(current date) * 1000 + dayofyear(current date) - 2000000 as IBMShortJulian,
year(current date) * 1000 + dayofyear(current date) as IBMJulian,
left(char(current time),2) || substr(char(current time),4,2) || substr(char(current time),7,2) as JDETime,
current time as SystemTime,
session_user as WhoAmI,
month(date(cast((1900000+sdupmj) as char(7)))) as MonthValue,
year(date(cast((1900000+sdupmj) as char(7)))) as YearValue,
dayofweek(date(cast((1900000+sdupmj) as char(7)))) as DayOfWeekValue,
dayname(date(cast((1900000+sdupmj) as char(7)))) as DayNameValue
from PRODdta.f4211
fetch first 1 rows only;