Re: date format?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: date format?

Sacha Black
I've got point data in a MySQL database that I am displaying in my
map. I'd like to label the points with a date, but the date format
stored in the database looks like this:

"2008-06-17 00:00:00"

and we would like to put a label on the map in some kind of more user
friendly format (and omitting the time portion which we do not
need).... is this kind of re-formatting for labels possible in
Mapserver? Prefer not to create a new field in the DB as there are
thousands of records...

any ideas?

sacha


Fri May 9 09:53:29 EDT 2008

Hi list,

using a shapefile with a Date column, is it possible to change the date
format (string) that Mapserver will use in the WFS GetFeature output?

Now it outputs:

<ms:Discovery_date>19690101</ms:Discovery_date>

whereas we would want 1969-01-01

Best regards,
Bart
_______________________________________________
mapserver-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapserver-users
Reply | Threaded
Open this post in threaded view
|

RE: date format?

Fawcett, David (MNIT)
Have you tried using a date format function in your SQL statement?  
http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#func
tion_date-format

David.

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Sacha
Black
Sent: Wednesday, July 30, 2008 3:07 PM
To: [hidden email]
Subject: Re: [mapserver-users] date format?


I've got point data in a MySQL database that I am displaying in my map.
I'd like to label the points with a date, but the date format stored in
the database looks like this:

"2008-06-17 00:00:00"

and we would like to put a label on the map in some kind of more user
friendly format (and omitting the time portion which we do not need)....
is this kind of re-formatting for labels possible in Mapserver? Prefer
not to create a new field in the DB as there are thousands of records...

any ideas?

sacha


Fri May 9 09:53:29 EDT 2008

Hi list,

using a shapefile with a Date column, is it possible to change the date
format (string) that Mapserver will use in the WFS GetFeature output?

Now it outputs:

<ms:Discovery_date>19690101</ms:Discovery_date>

whereas we would want 1969-01-01

Best regards,
Bart
_______________________________________________
mapserver-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapserver-users
_______________________________________________
mapserver-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapserver-users
Reply | Threaded
Open this post in threaded view
|

Re: date format?

Sacha Black
Hi David,

a belated thank you for this tip - I didn't think of trying to do it
in the select statement. For the record here is the syntax I used:

SELECT DATE_FORMAT(My_DATE_FieldName,'%W %M %D, %Y') ... etc.

produces a nice date like:

Monday September 20th, 2004

thanks again,

Sacha

On Wed, Jul 30, 2008 at 1:13 PM, Fawcett, David
<[hidden email]> wrote:

> Have you tried using a date format function in your SQL statement?
> http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#func
> tion_date-format
>
> David.
>
> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of Sacha
> Black
> Sent: Wednesday, July 30, 2008 3:07 PM
> To: [hidden email]
> Subject: Re: [mapserver-users] date format?
>
>
> I've got point data in a MySQL database that I am displaying in my map.
> I'd like to label the points with a date, but the date format stored in
> the database looks like this:
>
> "2008-06-17 00:00:00"
>
> and we would like to put a label on the map in some kind of more user
> friendly format (and omitting the time portion which we do not need)....
> is this kind of re-formatting for labels possible in Mapserver? Prefer
> not to create a new field in the DB as there are thousands of records...
>
> any ideas?
>
> sacha
>
>
> Fri May 9 09:53:29 EDT 2008
>
> Hi list,
>
> using a shapefile with a Date column, is it possible to change the date
> format (string) that Mapserver will use in the WFS GetFeature output?
>
> Now it outputs:
>
> <ms:Discovery_date>19690101</ms:Discovery_date>
>
> whereas we would want 1969-01-01
>
> Best regards,
> Bart
> _______________________________________________
> mapserver-users mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>
_______________________________________________
mapserver-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapserver-users