<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: date output format in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/date-output-format/m-p/409878#M37758</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;have you found the solution? &lt;BR /&gt;mine is coded this way:&lt;BR /&gt;&lt;BR /&gt;layerDefs[0] = "ZON='DATE = TO_DATE('"+ (dojo.byId('DATE').value) +"','YYYY-MM-DD')";&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thank you, but using the google extensions apis I prefer jquery to dojo.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Formatting date with javascript is quite simple in jquery also:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;$.format.date(attribute["FIELD_NAME"],'dd/MM/yyyy')&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, I was looking for something different from a javascript workaround but at the moment - if I understood well - it is not possible.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 06 Jul 2010 06:06:06 GMT</pubDate>
    <dc:creator>AlessioDi_Lorenzo</dc:creator>
    <dc:date>2010-07-06T06:06:06Z</dc:date>
    <item>
      <title>date output format</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/date-output-format/m-p/409872#M37752</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;when I execute a query against a mapservice i get dates in this format:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Mon Jun 28 00:00:00 CEST 2010&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;using jquery I'm able to format it as dd/mm/yyyy&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My question is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;is there a way to translate the date directly into the query? &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Something like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
// Query
myQuery = new esri.arcgis.gmaps.Query();
myQuery.outFields = ["ID","NAME","TO_CHAR(DATE, dd/mm/yyyy)"];
myQuery.where = "1=1";
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thx&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Jul 2010 09:05:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/date-output-format/m-p/409872#M37752</guid>
      <dc:creator>AlessioDi_Lorenzo</dc:creator>
      <dc:date>2010-07-01T09:05:10Z</dc:date>
    </item>
    <item>
      <title>Re: date output format</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/date-output-format/m-p/409873#M37753</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;what you've shown there is not possible i don't think.&amp;nbsp; if you want it coming in directly as a formatted date i think your only option is to create a new field and calculate it from the DateTime field as text in whatever format you need.&amp;nbsp;&amp;nbsp; then you can specify that new field in your outFields list.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Jul 2010 11:52:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/date-output-format/m-p/409873#M37753</guid>
      <dc:creator>AdamPfister</dc:creator>
      <dc:date>2010-07-01T11:52:17Z</dc:date>
    </item>
    <item>
      <title>Re: date output format</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/date-output-format/m-p/409874#M37754</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;what you've shown there is not possible i don't think.&amp;nbsp; if you want it coming in directly as a formatted date i think your only option is to create a new field and calculate it from the DateTime field as text in whatever format you need.&amp;nbsp;&amp;nbsp; then you can specify that new field in your outFields list.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;mmm... yes, it works but it is still a workaround (even if better than the javascript one...) and I was looking for a native solution &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks anyway&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;OT&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;In my opinion esri's js apis is a good tool but it has to be improved from the point of view of the query management. At least ORDER BY and GROUP BY clause and the DISTINCT selection have to be supported!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Jul 2010 13:27:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/date-output-format/m-p/409874#M37754</guid>
      <dc:creator>AlessioDi_Lorenzo</dc:creator>
      <dc:date>2010-07-01T13:27:40Z</dc:date>
    </item>
    <item>
      <title>Re: date output format</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/date-output-format/m-p/409875#M37755</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;mmm... yes, it works but it is still a workaround (even if better than the javascript one...&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;awesome.&amp;nbsp; i had no idea you could inject SQL in that way.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Jul 2010 16:15:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/date-output-format/m-p/409875#M37755</guid>
      <dc:creator>AdamPfister</dc:creator>
      <dc:date>2010-07-01T16:15:04Z</dc:date>
    </item>
    <item>
      <title>Re: date output format</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/date-output-format/m-p/409876#M37756</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can, but it's kind of hacky and dependent on what is supported by the underlying data source. I would still format the date with JavaScript.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Jul 2010 17:03:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/date-output-format/m-p/409876#M37756</guid>
      <dc:creator>derekswingley1</dc:creator>
      <dc:date>2010-07-01T17:03:28Z</dc:date>
    </item>
    <item>
      <title>Re: date output format</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/date-output-format/m-p/409877#M37757</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;have you found the solution? &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;mine is coded this way:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;layerDefs[0] = "ZON='DATE = TO_DATE('"+ (dojo.byId('DATE').value) +"','YYYY-MM-DD')";&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Jul 2010 05:29:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/date-output-format/m-p/409877#M37757</guid>
      <dc:creator>hayaticm</dc:creator>
      <dc:date>2010-07-06T05:29:16Z</dc:date>
    </item>
    <item>
      <title>Re: date output format</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/date-output-format/m-p/409878#M37758</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;have you found the solution? &lt;BR /&gt;mine is coded this way:&lt;BR /&gt;&lt;BR /&gt;layerDefs[0] = "ZON='DATE = TO_DATE('"+ (dojo.byId('DATE').value) +"','YYYY-MM-DD')";&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thank you, but using the google extensions apis I prefer jquery to dojo.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Formatting date with javascript is quite simple in jquery also:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;$.format.date(attribute["FIELD_NAME"],'dd/MM/yyyy')&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, I was looking for something different from a javascript workaround but at the moment - if I understood well - it is not possible.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Jul 2010 06:06:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/date-output-format/m-p/409878#M37758</guid>
      <dc:creator>AlessioDi_Lorenzo</dc:creator>
      <dc:date>2010-07-06T06:06:06Z</dc:date>
    </item>
  </channel>
</rss>

