i5_ function for file date/timestamp

The place for general PHP questions and hints for PHP on IBM i
User avatar
Posts: 1778
Joined: Thu Dec 11, 2008 1:08 pm

Re: i5_ function for file date/timestamp

Post by kentatzend » Fri Oct 07, 2011 12:51 am

The new XML Service is capable of calling an APIs too. So the statement that it "only supports the PGM calls and some DB requests" is inaccurate. BTW if you were to write a program to get the data you want then ether the exiting I5 toolkit or the new XML Service as both would work. While Zend would probably recommend using the new toolkit as it is our stated long term direction, both soltuions are viable options so you to decide which make more sense for you.

Posts: 11
Joined: Thu Nov 19, 2009 2:22 pm

Re: i5_ function for file date/timestamp

Post by sylvain_aura » Fri Oct 07, 2011 8:39 am

Why don't you use i5command() and run RTVOBJD or RTVMBRD to retrieve properties.
I think "CHGDATE" is the value you are looking for.

$ret = i5_command ( "rtvobjd", array ("obj"=>"MYLIB/MYFILE", "objtype"=>"*FILE"), array ("CHGDATE" => "chgdate") );
if ($ret == false) {
$error = i5_error ();
print_r ( $error );
echo "<BR>Chg date : <span class='rouge'>" . $chgdate . "</span><BR>";


Posts: 171
Joined: Fri Apr 10, 2009 12:41 am
Location: Toronto

Re: i5_ function for file date/timestamp

Post by chris_hird » Fri Oct 07, 2011 12:57 pm


I had not realized the XMLSERVICE could call native API's? But as they are simply programs I can see that should be possible. The OP has plenty of options.

Shield Advanced Solutions Ltd
Home of JobQGenie and the Receiver Apply Program

Posts: 43
Joined: Mon Oct 03, 2011 5:22 pm

Re: i5_ function for file date/timestamp

Post by ahaithcox » Fri Oct 07, 2011 2:30 pm

Sylvain hit the nail on the head! That's exactly what I was looking for.
The return was (with var_dump):

string(13) "1111004115029"

I'm a little embarrassed that I didn't discover that myself. But I guess that's why we join communities such as this.

Thanks so much for the help from all.

Post Reply