title: Convert Date Time based on Locale
body: <p>Hello I am new to FTL Code and I am trying to re  format a date based on how a locale would display it.</p>
  <p>The error I am getting: (Please look below for more info of the result we want)</p>
  <p>The string doesn't match the expected date/time/date-time format. The string to parse was: &quot;août 26, 2035&quot;. The expected format was: &quot;MM dd, yyyy&quot;.
  The nested reason given follows:
  Unparseable date: &quot;août 26, 2035&quot;</p>
  <pre><code>&lt;#assign locale = userPreferences.getLanguage()&gt;
          my locale ${locale}&lt;br&gt;
          &lt;#if locale = &quot;en_AU&quot;&gt;
              original = ${couponData.expiration}&lt;br&gt;
              &lt;#assign expiryDate = couponData.expiration?date(&quot;dd MM, yyyy&quot;)?string(&quot;dd MM yyyy&quot;)&gt;
              format ${expiryDate} &lt;br&gt;
              ${sys.declare(&quot;dateMonthYear&quot;, expiryDate)}
          &lt;#elseif locale = &quot;en_GB&quot;&gt;
              original = ${couponData.expiration}&lt;br&gt;
              
              &lt;#assign expiryDate = couponData.expiration?date(&quot;MM dd, yyyy&quot;)?string(&quot;dd MM yyyy&quot;)&gt;
              format ${expiryDate} &lt;br&gt;
              ${sys.declare(&quot;dateMonthYear&quot;, expiryDate)}
          &lt;#elseif locale = &quot;fr_CA&quot;&gt;
              original = ${couponData.expiration}&lt;br&gt;
              &lt;#assign expiryDate = couponData.expiration?date(&quot;MMM dd, yyyy&quot;)?string(&quot;dd MM. yyyy&quot;)&gt;
              format ${expiryDate} &lt;br&gt;
              ${sys.declare(&quot;dateMonthYear&quot;, expiryDate)}
          &lt;#else&gt;
              ${sys.declare(&quot;dateMonthYear&quot;, &quot;${couponData.expiration}&quot;)}
          &lt;/#if&gt; 
  </code></pre>
  <p>CA_FR Source:</p>
  <pre><code>Ends Jul 31, 2022
  Actual:
  
  Expire le juil. 31, 2022
  Expected:
  
  Expire le 31 juil. 2022
  </code></pre>
  <p>EN_GB Source:</p>
  <pre><code>Ends Jul 31, 2022.
  Actual:
  
  Ends Jul 31, 2022.
  Expected:
  
  Ends 31 Jul 2022.
  enter code here
  </code></pre>
  <p>EN_AU  Source:</p>
  <p>Ends Jul 31, 2022.
  Actual:</p>
  <p>Ends 31 Jul, 2022.
  Expected:</p>
  <p>Ends 31 Jul 2022.</p>