<?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: Field Calculator Format Function in Data Management Questions</title>
    <link>https://community.esri.com/t5/data-management-questions/field-calculator-format-function/m-p/418063#M23853</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi&lt;BR /&gt;&lt;BR /&gt;Format function in VB returns a type mismatch error. &lt;BR /&gt;The expression I am trying to execute is like this: Date_Str_Field = Format("06/24/2013", "dd-mm-yyyy").&lt;BR /&gt;Does not ArcMAp 10.1 support this function anymore?&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Format is a VBA function, not a VB Script function and is no longer supported by ArcMap 10.1.&amp;nbsp; VB script has a &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://msdn.microsoft.com/en-us/library/8aebkz6s(v=vs.84).aspx" rel="nofollow" target="_blank"&gt;FormatDateTime function&lt;/A&gt;&lt;SPAN&gt;, but if the format does not match your regional settings, it is not at all easy to force the date into a custom format.&amp;nbsp; You basically have to write all of the parsing and formatting steps yourself for each date component, which is tedious.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Python should be something like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;import datetime&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Date_Str_Field = datetime.datetime.strptime('06/24/2013', '%m/%d/%Y').date().strftime('%d-%m-%Y')&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 24 Jun 2013 15:08:25 GMT</pubDate>
    <dc:creator>RichardFairhurst</dc:creator>
    <dc:date>2013-06-24T15:08:25Z</dc:date>
    <item>
      <title>Field Calculator Format Function</title>
      <link>https://community.esri.com/t5/data-management-questions/field-calculator-format-function/m-p/418062#M23852</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Format function in VB returns a type mismatch error. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The expression I am trying to execute is like this: Date_Str_Field = Format("06/24/2013", "dd-mm-yyyy").&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Does not ArcMAp 10.1 support this function anymore?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Jun 2013 14:40:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/field-calculator-format-function/m-p/418062#M23852</guid>
      <dc:creator>OleksandrChubatyy</dc:creator>
      <dc:date>2013-06-24T14:40:51Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculator Format Function</title>
      <link>https://community.esri.com/t5/data-management-questions/field-calculator-format-function/m-p/418063#M23853</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi&lt;BR /&gt;&lt;BR /&gt;Format function in VB returns a type mismatch error. &lt;BR /&gt;The expression I am trying to execute is like this: Date_Str_Field = Format("06/24/2013", "dd-mm-yyyy").&lt;BR /&gt;Does not ArcMAp 10.1 support this function anymore?&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Format is a VBA function, not a VB Script function and is no longer supported by ArcMap 10.1.&amp;nbsp; VB script has a &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://msdn.microsoft.com/en-us/library/8aebkz6s(v=vs.84).aspx" rel="nofollow" target="_blank"&gt;FormatDateTime function&lt;/A&gt;&lt;SPAN&gt;, but if the format does not match your regional settings, it is not at all easy to force the date into a custom format.&amp;nbsp; You basically have to write all of the parsing and formatting steps yourself for each date component, which is tedious.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Python should be something like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;import datetime&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Date_Str_Field = datetime.datetime.strptime('06/24/2013', '%m/%d/%Y').date().strftime('%d-%m-%Y')&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Jun 2013 15:08:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/field-calculator-format-function/m-p/418063#M23853</guid>
      <dc:creator>RichardFairhurst</dc:creator>
      <dc:date>2013-06-24T15:08:25Z</dc:date>
    </item>
  </channel>
</rss>

