ibexa

Path

ez publish / technical manual / 4.x / reference / datatypes / date and time


Caution: This documentation is for eZ Publish legacy, from version 3.x to 5.x.

Date and time

Summary

Validates and stores a date and a time value.

Properties

NameInternal nameSearchableInformation collector
Date and time ezdatetime Yes. No.

Description

This datatype allows the validation, storage and retrieval of a date/time value. It is capable of storing a date/time consisting of a year, month, day, hour and minute value. The following screenshot shows the class attribute edit interface for this datatype.

Class attribute edit interface for the "Datetime" datatype.

Class attribute edit interface for the "Datetime" datatype.

Default value

The "Default value" parameter can be used to control the initial value of an attribute using this datatype when a new object is created. There are three options:

  • Empty
  • Current datetime
  • Adjusted current datetime

The default setting is "Empty", which means that when a new object is created, the attribute using this datatype will be empty. If the "Current datetime" option is used, the current date and time will be set. If the "Adjusted datetime" is used, an adjusted value of the current date and time will be set. How much the current date and time should be adjusted must be specified using the fields within the "Current datetime adjusted by" group.

Current datetime adjusted by

The fields within this group can be used to specify the desired date/time adjustment when the ("Adjusted current datetime") option is used. Both positive and negative numerical values are allowed. If the values given in the example above are used and an object is created at 00:00 on the first of January 2005, the initial value of the attribute will be set to 04:05, third of February, 2006.

Object attribute edit interface

The following screenshot shows the object attribute interface for this datatype.

Object attribute edit interface for the "Date and time" datatype.

Object attribute edit interface for the "Date and time" datatype.

Raw output

The ".content" of an ezcontentobjectattribute object using this datatype returns an ezdatetime object.

Balazs Halasy (21/02/2005 2:36 pm)

Balazs Halasy (29/04/2005 11:04 am)


Comments

  • Datetime Format

    To format your datetime class attribute:

    In datetime.ini.append.php
    [ClassSettings]  Formats[<myclass>]=%Y.%M.....
    


    In yourtemplate.tpl
    {$node.data_map.date.content.timestamp|datetime('<myclass>')}