Difference between revisions of "Timestamp field"

From EPrints Documentation
Jump to: navigation, search
(Added timestamp field)
 
m
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
{{fieldtypes}}
 
{{fieldtypes}}
__NOTOC__
+
 
 +
 
 +
== Description ==
 +
This field is almost exactly the same as a [[Time field]] except it has the default value of the current time.  So this will be implicitly said if another value is not specified.  Therefore, this type of field is useful to capture the exact time a data object is created.
 +
 
 
== Inheritance ==
 
== Inheritance ==
 
 
* [[Metadata]]
 
* [[Metadata]]
 
** [[Date field]]
 
** [[Date field]]
Line 8: Line 11:
 
**** [[Timestamp field]]
 
**** [[Timestamp field]]
  
== Description ==
+
== Additional Properties ==
 
+
As for [[Time field#Additional_Phrases|Time fields]].
== Properties ==
 
 
 
{| border="1" cellpadding="3" cellspacing="0"
 
| name || default || description
 
|-
 
| '''min_resolution''' || second|| '''This property is taken from the repository configuration.'''
 
|-
 
| '''render_res''' || second || '''This property is taken from the repository configuration.'''
 
|-
 
| '''render_style''' || long || '''This property is taken from the repository configuration.'''
 
|-
 
 
 
|}
 
  
 
== Required Phrases ==
 
== Required Phrases ==
 
+
No additional phrases beyond those required for [[Time field#Required_Phrases|Time fields]].
  
 
== Database ==
 
== Database ==
 
+
Timestamp fields are stored in the database as
Int fields are stored in the database as
 
 
 
 
  fieldname_year SMALLINT(6)
 
  fieldname_year SMALLINT(6)
 
  fieldname_month SMALLINT(6)
 
  fieldname_month SMALLINT(6)
  fieldname_daye SMALLINT(6)
+
  fieldname_day SMALLINT(6)
 
  fieldname_hour SMALLINT(6)
 
  fieldname_hour SMALLINT(6)
 
  fieldname_minute SMALLINT(6)
 
  fieldname_minute SMALLINT(6)
 
  fieldname_second SMALLINT(6)
 
  fieldname_second SMALLINT(6)
 +
 +
== API ==
 +
See [[API:EPrints/MetaField/Timestamp|API page]].
 +
 +
== Examples ==
 +
Most basic example.
 +
{
 +
    name => 'created'
 +
    type => 'timestamp',
 +
}

Latest revision as of 23:20, 9 April 2023

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


Metadata Fields: Arclanguage - Base64 - Bigint - Boolean - Compound - Counter - Dataobjref - Date - Decimal - Email - Fields - Float - Id - Idci - Image - Int - Itemref - Keywords - Langid - Longtext - Longtext_counter - Multilang - Multipart - Name - Namedset - Pagerange - Recaptcha - Relation - Search - Secret - Set - Storable - Subject - Subobject - Text - Time - Timestamp - Url - Uuid


Description

This field is almost exactly the same as a Time field except it has the default value of the current time. So this will be implicitly said if another value is not specified. Therefore, this type of field is useful to capture the exact time a data object is created.

Inheritance

Additional Properties

As for Time fields.

Required Phrases

No additional phrases beyond those required for Time fields.

Database

Timestamp fields are stored in the database as

fieldname_year SMALLINT(6)
fieldname_month SMALLINT(6)
fieldname_day SMALLINT(6)
fieldname_hour SMALLINT(6)
fieldname_minute SMALLINT(6)
fieldname_second SMALLINT(6)

API

See API page.

Examples

Most basic example.

{
    name => 'created'
    type => 'timestamp',
}