Difference between revisions of "API:EPrints/MetaField/Time"

From EPrints Documentation
Jump to: navigation, search
(Removing all content from page)
Line 1: Line 1:
 +
<!-- Pod2Wiki=_preamble_
 +
This page has been automatically generated from the EPrints 3.2 source. Any wiki changes made between the 'Pod2Wiki=*' and 'Edit below this comment' comments will be lost.
 +
-->{{API}}{{Pod2Wiki}}{{API:Source|file=perl_lib/EPrints/MetaField/Time.pm|package_name=EPrints::MetaField::Time}}[[Category:API|TIME]][[Category:API:EPrints/MetaField|TIME]][[Category:API:EPrints/MetaField/Time|TIME]]<div><!-- Edit below this comment -->
  
 +
 +
<!-- Pod2Wiki=_private_ --><!-- Pod2Wiki=head_name -->
 +
==NAME==
 +
EPrints::MetaField::Time - date + time
 +
 +
<!-- Edit below this comment -->
 +
 +
 +
<!-- Pod2Wiki= -->
 +
<!-- Pod2Wiki=head_description -->
 +
==DESCRIPTION==
 +
Can store a time value upto seconds granularity. The time must be in UTC because this field can not store the time zone part.
 +
 +
The value is set and returned as a string formatted as:
 +
 +
<pre>  YYYY-MM-DD hh:mm:ss</pre>
 +
 +
Where:
 +
 +
<pre>  YYYY - year
 +
  MM - month (01-12)
 +
  DD - day (01-31)
 +
  hh - hours (00-23)
 +
  mm - minutes (00-59)
 +
  ss - seconds (00-59)</pre>
 +
 +
Note: if you set the time using ISO datetime format (YYYY-MM-DDThh:mm:ssZ) it will automatically be converted into the native format.
 +
 +
<!-- Edit below this comment -->
 +
 +
 +
<!-- Pod2Wiki= -->
 +
<!-- Pod2Wiki=head_properties -->
 +
==PROPERTIES==
 +
In addition to those properties available in [[API:EPrints/MetaField/Date|EPrints::MetaField::Date]] and [[API:EPrints/MetaField|EPrints::MetaField]]:
 +
 +
<!-- Edit below this comment -->
 +
 +
 +
<!-- Pod2Wiki= -->
 +
<!-- Pod2Wiki=head_render_res -->
 +
===render_res===
 +
Reduce the resolution the date is shown as.
 +
 +
* '''"second"'''
 +
* "minute"
 +
* "hour"
 +
<!-- Edit below this comment -->
 +
 +
 +
<!-- Pod2Wiki= -->
 +
<!-- Pod2Wiki=head_methods -->
 +
==METHODS==
 +
<!-- Pod2Wiki=head_iso_value -->
 +
===iso_value===
 +
 +
<source lang="perl">$datetime = $time->iso_value( $dataobj )
 +
 +
</source>
 +
Returns the value of this field from $dataobj in ISO datetime format (YYYY-MM-DDThh:mm:ssZ).
 +
 +
Returns undef if the value is unset.
 +
 +
<!-- Edit below this comment -->
 +
 +
 +
<!-- Pod2Wiki= -->
 +
<!-- Pod2Wiki=head_see_also -->
 +
==SEE ALSO==
 +
[[API:EPrints/MetaField/Date|EPrints::MetaField::Date]].
 +
 +
<!-- Pod2Wiki=head_copyright -->
 +
==COPYRIGHT==
 +
Copyright 2000-2011 University of Southampton.
 +
 +
This file is part of EPrints http://www.eprints.org/.
 +
 +
EPrints is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
 +
 +
EPrints is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
 +
 +
You should have received a copy of the GNU Lesser General Public License along with EPrints.  If not, see http://www.gnu.org/licenses/.
 +
 +
<!-- Edit below this comment -->
 +
 +
 +
<!-- Pod2Wiki= -->
 +
<!-- Pod2Wiki=_postamble_ -->
 +
<!-- Edit below this comment -->

Revision as of 14:34, 11 April 2012

EPrints 3 Reference: Directory Structure - Metadata Fields - Repository Configuration - XML Config Files - XML Export Format - EPrints data structure - Core API - Data Objects


API: Core API

Latest Source Code (3.3, 3.2) | Revision Log | Before editing this page please read Pod2Wiki


NAME

EPrints::MetaField::Time - date + time


DESCRIPTION

Can store a time value upto seconds granularity. The time must be in UTC because this field can not store the time zone part.

The value is set and returned as a string formatted as:

  YYYY-MM-DD hh:mm:ss

Where:

  YYYY - year
  MM - month (01-12)
  DD - day (01-31)
  hh - hours (00-23)
  mm - minutes (00-59)
  ss - seconds (00-59)

Note: if you set the time using ISO datetime format (YYYY-MM-DDThh:mm:ssZ) it will automatically be converted into the native format.


PROPERTIES

In addition to those properties available in EPrints::MetaField::Date and EPrints::MetaField:


render_res

Reduce the resolution the date is shown as.

  • "second"
  • "minute"
  • "hour"


METHODS

iso_value

$datetime = $time->iso_value( $dataobj )

Returns the value of this field from $dataobj in ISO datetime format (YYYY-MM-DDThh:mm:ssZ).

Returns undef if the value is unset.


SEE ALSO

EPrints::MetaField::Date.

COPYRIGHT

Copyright 2000-2011 University of Southampton.

This file is part of EPrints http://www.eprints.org/.

EPrints is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

EPrints is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with EPrints. If not, see http://www.gnu.org/licenses/.