[mapserver-users] RE: formatting in HTML templates

Lime, Steve D (DNR) Steve.Lime at state.mn.us
Tue Feb 15 16:10:57 EST 2011


I don't think it's possible to pass the MapServer processed template back through a PHP interpreter. Easiest thing IMHO would
be to do this using javascript embedded in the template. I think it has pretty good date/time support.

<script>
  var aqTime = '[datetime column]';
  // convert to a date/time object and display.
</script>

Just an idea.

Steve

From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of David Hildebrand
Sent: Tuesday, February 15, 2011 1:41 PM
To: mapserver-users
Subject: [mapserver-users] formatting in HTML templates

This may be slightly off the MapServer topic but my problem is related to a MapServer implementation.

I am retrieving the date and time from the shapefile DBF of my layer in the following format (yymmddhhmmss).  The string represents the UTC time of satellite image acquisition.  I want to convert that to local time and express it as a normal date string (e.g.: July 8, 2009 10:45:25 AM).  I'm thinking I can do that with PHP code embedded in the template.  I know my server has PHP support but when I try to embed a simple 'Hello world' in the template it seems to be ignored.  Would it be better define a URL to the PHP code (in stead of a template) and then build the entire HTML page dynamically?

Thanks.

===========================
David V. Hildebrand
Agriculture Financial Services Corporation
(403) 782-8239

www.afsc.ca<about:www.afsc.ca> <http://www.afsc.ca<http://www.afsc.ca/>>
This communication is intended for the use of the recipient to which it is addressed, and may contain confidential, personal and/or privileged information. Please contact Agriculture Financial Services Corporation immediately if you are not the intended recipient of this communication, and do not copy, distribute, or take action relying on it. Any communication received in error, or subsequent reply, should be deleted or destroyed. Please consider the environment before printing this email.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20110215/aba38150/attachment.html


More information about the mapserver-users mailing list