[interchange-docs] xmldocs - docelic modified refs/datetime2epoch.filter

docs at icdevgroup.org docs at icdevgroup.org
Wed Apr 30 00:58:21 UTC 2008


User:      docelic
Date:      2008-04-30 00:58:21 GMT
Added:     refs     datetime2epoch.filter
Log:
* datetime2epoch

Revision  Changes    Path
1.1                  xmldocs/refs/datetime2epoch.filter


rev 1.1, prev_rev 1.0
Index: datetime2epoch.filter
===================================================================
__NAME__ purpose
convert date (possibly with specified time) to number of seconds since Epoch
__END__


__NAME__ see also
date2time
__END__


__NAME__ description
The filter replaces date specification with optional time, in format of
</para><para>
<literal><replaceable>MM</replaceable>[/-]<replaceable>DD</replaceable>[/-]<replaceable>YY(YY)?</replaceable>(:<replaceable>hh</replaceable>(:?<replaceable>mm</replaceable>(:<replaceable>ss</replaceable>)?)?)?</literal>, or<sbr/>
<literal><replaceable>YYYY</replaceable>-<replaceable>MM</replaceable>-<replaceable>DD</replaceable>([<replaceable>T </replaceable>]<replaceable>hh</replaceable>(:<replaceable>mm</replaceable>(:<replaceable>ss</replaceable>)?)?)?</literal>
</para><para>
to a number of seconds since Unix &glos-epoch;.
</para><para>
If the year specification contains 2 digits only and is less than 
<literal>50</literal>, then it is treated as an offset from year
<literal>2000</literal>, and not <literal>1900</literal>.
In other words, <literal>05</literal> is understood
as year <literal>2005</literal>,
<literal>80</literal> is understood as
<literal>1980</literal>.
</para><para>
Unspecified month or day default to <literal>01</literal>, unspecified
hours or minutes default to <literal>00</literal>.
__END__


__NAME__ notes
This filter is designed to replace &filter-date2time;, which can
be considered deprecated.
</para><para>
For more information on &PERL; Regular Expressions, pattern matching and
character classes, see
<citerefentry><refentrytitle>perlre</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
</para><para>
The <function>timelocal()</function> function used in the filter comes from the
<classname>Time::Local</classname> &PERL; module.
__END__

__NAME__ online: Converting dates and times to seconds since Epoch
<programlisting><![CDATA[
[filter date2time]01/01/2008[/filter]
[filter date2time]01/01/08[/filter]

[filter date2time]01-01-2008[/filter]
[filter date2time]01-01-08[/filter]

[filter date2time]01-01-2008:10[/filter]
[filter date2time]01-01-08:10:45[/filter]
[filter date2time]01-01-08:10:45:00[/filter]
]]></programlisting>
__END__


__NAME__ online: Converting ISO/MySQL dates and times to seconds since Epoch
<programlisting><![CDATA[
[filter date2time]2008-01-01 10[/filter]
[filter date2time]2008-01-01 10:45[/filter]
[filter date2time]2008-01-01 10:45:00[/filter]
]]></programlisting>
__END__

__NAME__ author
&kwalsh;
__END__







More information about the docs mailing list