Hi Robert -

I don't have an answer for you, but I do have a diagnostic suggestion... sorry if this is stuff you've already thought of.

The timestamp you're seeing is the UNIX date and time at 0.

I'd suggest confirming that $m->current_comp->source_file is returning a useful name, and that stat is returning a useful value...to see if the problem is with one of them.

Perhaps $m->current_comp->source_file is returning a relative path and stat isn't finding the file? I've never used $m->current_comp->source_file, so I'm just guessing here. But adding something along the lines of:

<%init>
  my $comp_name = $m->current_comp->source_file;
  my $stat_time = stat($comp_file)[9];
</%init>

<p>Comp name: <% $comp_name %></p>
<p>Stat time: <% $stat_time %></p>

to your component might be enlightening. That would be my next step. If $stat_time is 0 and $comp_name is reasonable then there's something weird going on with the stat call. If $stat_time isn't 0 then the problem is in the Time::Piece line. Good luck!
    - john romkey
    http://www.romkey.com/

Robert Hicks wrote:
<%init>
    my $comp_time = (stat $m->current_comp->source_file)[9];
    my $last_mod = Time::Piece->strptime( $comp_time, '%s' )->strftime( 
'%B %e, %Y %H:%M' );
</%init>

<table width="100%" cellspacing="0" cellpadding="5">
    <tr>
     <td class="heading"><h1>What's New?</h1></td>
    </tr>
    <tr>
     <td>
      <p>
      The whole site, at this point.
      </p>
      <p>
      <em>Last modified: <% $last_mod %></em>
      </p>
     </td>
    </tr>
</table>

That used to return that last mod date of the source file but now it is 
returning:

Last modified: January , 1970 00:00

I am calling it from the main page like: % $m->comp('inc/news.msn');

I checked with Matt S. to see if Time::Piece was the issue since a new 
version came out and he says it should work. I also upgraded to the 1.32 
version of Mason recently.

Any ideas?

Robert



_______________________________________________
Mason-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mason-users
  

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Mason-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mason-users

Reply via email to