title: date conversion in erlang
body: <p>I developed this function :</p>
  
  <pre><code>get_data_by_transaction(TransactionCode)-&gt;
  
   Q = qlc:q([{X#transaction.datetime} || X &lt;- mnesia:table(transaction),
                  X#transaction.transaction_code =:= TransactionCode]),
      case do(Q) of
          [{K}] -&gt;  
          {ok, K};
  
          [] -&gt;
              {error, notfound}
      end.
  </code></pre>
  
  <p>when I test this function I have this result :</p>
  
  <pre><code>{ok,{{2013,3,6},{7,12,49}}}
  </code></pre>
  
  <p>my goal is to have this kind of result :</p>
  
  <pre><code>06/03/2013 7:12
  </code></pre>
  
  <p>so I should convert my data to be in the new format</p>
  
  <p>can sameone help me to solve my problem</p>
  
  <p>I try with this code : </p>
  
  <pre><code>format_date({{Year, Month, Day}, {Hour, Minute, _}}) -&gt;
      lists:flatten(
          io_lib:format("~2..0B/~2..0B/~4..0B ~B:~2..0B", [Day, Month, Year, Hour,Minute])). 
  </code></pre>
  
  <p>and when I run this code I have :</p>
  
  <pre><code>3&gt; format_date({{2013,3,6},{7,12,3}}).           
  "06/03/2013 7:12"
  </code></pre>
  
  <p><strong>but my goal id not to display this result but to associate this result to a variable</strong></p>
  
  <p>I will try to follow the links  which are in the previous response</p>