API:EPrints/MetaField/Time

From EPrints Documentation
Revision as of 14:38, 11 April 2012 by Tdb01r (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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.4, 3.3) | 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( $value )

Returns $value 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/.