[mapserver-users] working with date formats in identify templates

Lime, Steve D (MNIT) Steve.Lime at state.mn.us
Fri Jun 13 13:11:00 PDT 2014


There's nothing inherent in templates to do this for you but there are options:


1.       Use javascript in the template, something like:

<tr>
                <td align="right"><b>GIS Date:</b></td>
<script>
  var date_jf = '[item name="Date"]';

  // process the date into something prettier
  var date = ...;

 // output the date (zillion ways to do this)
  document.write("<td>" + date +"</td>");
</script>
</tr>


2.       If you're using a db backend you could format things in your SQL.

Steve

From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Mark Volz
Sent: Friday, June 13, 2014 2:18 PM
To: mapserver-users at lists.osgeo.org
Subject: [mapserver-users] working with date formats in identify templates

Hello

I have a date that is in Julian format.  I would like to convert that date from Julian format such as '20140423' to something more user friendly like '4/23/2014' or 'April 23, 2014' etc.  Can I accomplish this through mapserver?

<tr>
                <td align="right"><b>GIS Date:</b></td>
                <td>[item name="Date"]</td>
</tr>

Thanks


Sincerely,
Mark Volz, GISP

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20140613/b3f7bee2/attachment.htm>


More information about the MapServer-users mailing list