<?xml version='1.0' ?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
               "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
<!ENTITY % myvars SYSTEM "../variables.ent">
%myvars;
]>
<sect1 id="variables">
<title>Variables</title>
 
<sect2 id="variables-datetime">
    <title>Date and Time Variables</title>
<authorblurb>
<para><phrase role="cvstag">($Id: variables.xml,v 1.3 2006/07/17 05:38:37 torbenb Exp $)</phrase></para>

<para>By <ulink url="mailto:joel@aufrecht.org">joel@aufrecht.org</ulink></para>
</authorblurb>

    <para>Starting with OpenACS 5.0 and the introduction of acs-lang,
    we recommend retrieving date/time information from the database in
    ANSI format and then using <ulink url="/api-doc/proc-view?proc=lc%5ftime%5ffmt">lc_time_fmt</ulink> to format it for display.</para>
    <example>
      <title>Getting datetime from the database ANSI-style</title>
      <programlisting>db_multirow -extend { mydate_pretty } {
    select to_char(mydate, 'YYYY-MM-DD HH24:MI:SS') as mydate_ansi,
          ...
    ...
} {
    set mydate_ansi [lc_time_system_to_conn $mydate_ansi]
    set mydate_pretty [lc_time_fmt $mydate_ansi "%x %X"]
}
</programlisting>
    </example>

</sect2>
</sect1>
