mirror of
https://github.com/php/doc-es.git
synced 2026-03-26 00:12:06 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@328584 c90b9560-bf6c-de11-be94-00142212c4b1
110 lines
3.1 KiB
XML
110 lines
3.1 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: fb8f8617efe7ef5c3488038bfcab2e8b8f9bb430 Maintainer: chuso Status: ready -->
|
|
<!-- Reviewed: no -->
|
|
|
|
<phpdoc:classref xml:id="class.mongodate" xmlns:phpdoc="http://php.net/ns/phpdoc" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
|
|
|
|
<title>La clase MongoDate</title>
|
|
<titleabbrev>MongoDate</titleabbrev>
|
|
|
|
<partintro>
|
|
|
|
<!-- {{{ Mongodate intro -->
|
|
<section xml:id="mongodate.intro">
|
|
&reftitle.intro;
|
|
<para>
|
|
Representa objetos de tipo fecha para la base de datos. Esta clase debe usarse para
|
|
almacenar fechas en la base de datos y para consultarlas. Por ejemplo:
|
|
</para>
|
|
<example>
|
|
<title>Almacenar datos con <classname>MongoDate</classname></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
// guardar una fecha en base de datos
|
|
$collection->save(array("ts" => new MongoDate()));
|
|
|
|
$start = new MongoDate(strtotime("2010-01-15 00:00:00"));
|
|
$end = new MongoDate(strtotime("2010-01-30 00:00:00"));
|
|
|
|
// encontrar fechas entre 1/15/2010 y 1/30/2010
|
|
$collection->find(array("ts" => array('$gt' => $start, '$lte' => $end)));
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
<para>
|
|
MongoDB almacena fechas en milisegundos tras la fecha de referencia. Esto significa que las fechas
|
|
<emphasis>no</emphasis> contienen información de zonas horarias. Si fuera necesario,
|
|
la zona horaria deberá ser almacenada en otro campo. Además, esto significa que cualquier
|
|
nivel de precisión más allá de milisegundos se perderá al leer o escribir en
|
|
la base de datos.
|
|
</para>
|
|
</section>
|
|
<!-- }}} -->
|
|
|
|
<section xml:id="mongodate.synopsis">
|
|
&reftitle.classsynopsis;
|
|
|
|
<!-- {{{ Synopsis -->
|
|
<classsynopsis>
|
|
<ooclass><classname>MongoDate</classname></ooclass>
|
|
|
|
<!-- {{{ Class synopsis -->
|
|
<classsynopsisinfo>
|
|
<ooclass>
|
|
<classname>MongoDate</classname>
|
|
</ooclass>
|
|
</classsynopsisinfo>
|
|
<!-- }}} -->
|
|
|
|
<classsynopsisinfo role="comment">Campos</classsynopsisinfo>
|
|
<fieldsynopsis>
|
|
<modifier>public</modifier>
|
|
<type>int</type>
|
|
<varname>sec</varname>
|
|
</fieldsynopsis>
|
|
<fieldsynopsis>
|
|
<modifier>public</modifier>
|
|
<type>int</type>
|
|
<varname>usec</varname>
|
|
</fieldsynopsis>
|
|
|
|
|
|
<classsynopsisinfo role="comment">&Methods;</classsynopsisinfo>
|
|
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.mongodate')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" />
|
|
</classsynopsis>
|
|
<!-- }}} -->
|
|
|
|
</section>
|
|
|
|
</partintro>
|
|
|
|
&reference.mongo.entities.mongodate;
|
|
|
|
</phpdoc:classref>
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|