i5_ function for file date/timestamp

The place for general PHP questions and hints for PHP on IBM i

Re: i5_ function for file date/timestamp

Postby kentatzend on 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.
User avatar
kentatzend
 
Posts: 1781
Joined: Thu Dec 11, 2008 1:08 pm

Re: i5_ function for file date/timestamp

Postby sylvain_aura on 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>";


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

Re: i5_ function for file date/timestamp

Postby chris_hird on Fri Oct 07, 2011 12:57 pm

Kent,

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.

Chris...
Shield Advanced Solutions Ltd
Home of JobQGenie and the Receiver Apply Program
http://www.shield.on.ca/Blog
chris_hird
 
Posts: 168
Joined: Fri Apr 10, 2009 12:41 am
Location: Toronto

Re: i5_ function for file date/timestamp

Postby ahaithcox on 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"
(CYYMMDDHHMMSS)

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.
ahaithcox
 
Posts: 43
Joined: Mon Oct 03, 2011 5:22 pm

Previous

Return to PHP Questions / Hints

Who is online

Users browsing this forum: No registered users and 0 guests