How to remove time from DATETIME Query Results
We have a workflow that retreives a datetime field. In the geodatabase, the field appears in shortdate format, just as we want.
However, when the data is published as a rest service, the datetime field shows the date plus a dummy time (eg 10/19/1992 12:00:00 AM).
We only want to display the date (eg 10/19/1992).
We are currently implementing a Silverlight Viewer.
Are there commands or tools either in with Workflow or the Silverlight Viewer to format the output of datetime fields?
Thanks for help with this.
Andrea
-
This works to give something like April 08, 2013. Can modify as needed.
dateVariable.ToString("MMMM dd, yyyy", System.Globalization.CultureInfo.InvariantCulture)
0 -
Hi Rowena,
Any chance you can post an example of how to use "dateVariable.ToString("MMMM dd, yyyy", System.Globalization.CultureInfo.InvariantCulture)"?
Thx in adavance.
Ken
0 -
Did you ever figure this out? I'm having the same problem now.
0 -
+1 0 -
Hi,
If you want to configure how the dateTime field shows up in the Feature Details Pane in Essentials 4.5.1, then you can set that in Essentials Manager > Site > Map > Layer List > Edit the Layer > Fields Tab. You click on "Add/Remove Fields" and select the dateTime column so that it gets added to the table. Once it is added, you can go in and configure how the field is displayed in the viewer.
_img_ alt="User-added image" src="https://latitudegeo--c.na53.content.force.com/servlet/rtaImage?eid=90760000000TUJw&feoid=Body&refid=0EM60000000LztD" _/_img_
In here, under the "Date Format", you can select whatever date or time format you like:
_img_ alt="User-added image" src="https://latitudegeo--c.na53.content.force.com/servlet/rtaImage?eid=90760000000TUJw&feoid=Body&refid=0EM60000000LztI" _/_img_
I hope this helps.
Regards,
Carmen0
Du måste logga in om du vill lämna en kommentar.
Kommentarer
5 kommentarer