(<literal>mdy</literal>) as
its first argument and as its second argument a pointer to a variable
of type date that should hold the result of the operation.
</para>
</listitem>
</varlistentry>
<varlistentry id="pgtypesdatedayofweek">
<term><function>PGTYPESdate_dayofweek</function></term>
<listitem>
<para>
Return a number representing the day of the week for a date value.
<synopsis>
int PGTYPESdate_dayofweek(date d);
</synopsis>
The function receives the date variable <literal>d</literal> as its only
argument and returns an integer that indicates the day of the week for
this date.
<itemizedlist>
<listitem>
<para>
0 - Sunday
</para>
</listitem>
<listitem>
<para>
1 - Monday
</para>
</listitem>
<listitem>
<para>
2 - Tuesday
</para>
</listitem>
<listitem>
<para>
3 - Wednesday
</para>
</listitem>
<listitem>
<para>
4 - Thursday
</para>
</listitem>
<listitem>
<para>
5 - Friday
</para>
</listitem>
<listitem>
<para>
6 - Saturday
</para>
</listitem>
</itemizedlist>
</para>
</listitem>
</varlistentry>
<varlistentry id="pgtypesdatetoday">
<term><function>PGTYPESdate_today</function></term>
<listitem>
<para>
Get the current date.
<synopsis>
void PGTYPESdate_today(date *d);
</synopsis>
The function receives a pointer to a date variable (<literal>d</literal>)
that it sets to the current date.
</para>
</listitem>
</varlistentry>
<varlistentry id="pgtypesdatefmtasc">
<term><function>PGTYPESdate_fmt_asc</function></term>
<listitem>
<para>
Convert a variable of type date to its textual representation using a
format mask.
<synopsis>
int PGTYPESdate_fmt_asc(date dDate, char *fmtstring, char *outbuf);
</synopsis>
The function receives the date to convert (<literal>dDate</literal>), the
format mask (<literal>fmtstring</literal>) and the string that will hold the
textual representation of the date (<literal>outbuf</literal>).
</para>
<para>
On success, 0 is returned and a negative value if an error occurred.
</para>
<para>
The following literals are the field specifiers you can use:
<itemizedlist>
<listitem>
<para>
<literal>dd</literal> - The number of the day of the month.
</para>
</listitem>
<listitem>
<para>
<literal>mm</literal> - The number of the month of the year.
</para>
</listitem>
<listitem>
<para>
<literal>yy</literal> - The number of the year as a two digit number.
</para>
</listitem>
<listitem>
<para>
<literal>yyyy</literal> - The number of the year as a four digit number.
</para>
</listitem>
<listitem>
<para>
<literal>ddd</literal> - The name of the day (abbreviated).
</para>
</listitem>
<listitem>
<para>
<literal>mmm</literal> - The name of the month (abbreviated).
</para>
</listitem>
</itemizedlist>
All other characters are copied 1:1 to the output string.
</para>
<para>
<xref linkend="ecpg-pgtypesdate-fmt-asc-example-table"/> indicates a few possible formats. This will give
you an idea of how to use this function. All output lines are based on
the same date: November 23, 1959.
</para>
<table id="ecpg-pgtypesdate-fmt-asc-example-table">