java.util.date returns 502 from jtOpen ObjectDescription.RESTORE_DATE

49 Views Asked by At

I have the following in jython talking to an AS400:

system = AS400(ip, USER, PWORD)
obj = ObjectDescription(system, 'qsys','jbrdata', 'lib')
d = obj.RESTORE_DATE

The object that returns is a java.util.DATE/INT but unlike what i expected its only a 3 digit response. I need to get the date in a YYYYMMDD format

Can someone please help me with this?

I looked at the documentation here but it doesn't seem helpful

1

There are 1 best solutions below

0
David G On

Since the getValue(ObjectDescription.RESTORE_DATE) method is returning a Date object, you'll need to format it as a date.

In Java you can do this using a DateFormat object.

DateFormat df = new SimpleDateFormat("ymd");