Message-ID: <1492760075.3924.1485855900404.JavaMail.confluence@ip-10-127-227-164> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_3923_493535240.1485855900403" ------=_Part_3923_493535240.1485855900403 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html The Time FieldType

The Time FieldType

This field type represents a time information.

Name Internal name Expected input type
Time eztime mixed

Table of contents:

=20 =20

Description


This FieldType makes possible to store and retrieve a time information.<= /p>

Date information is not stored.

What is stored is number of seconds, calculated from the beginning of th= e day in the given or the environment timezone.

Input expectations


If input value is of type string or integer, it will be passed directly to the PHP's built-in \DateTime class constructor, therefore the same input format expectations appl= y.

It is also possible to directly pass an instance of \DateT= ime.

Type Example
string "2012-08-28 12:20 Europe/Berlin"
integer
1346149200
\DateTime
new \DateTime()

Value object


Properties

The Value class of this field type contains the following properties:

Property Type Description
$time integer|null Holds the the time information as = a number of seconds since the beginning of a day.

Constructor

The constructor for this value object will initialize a new Value o= bject with the value provided. It accepts an integer representing the numbe= r of seconds since the beginning of a day.

String representation

String representation of the date value will generate the date string in= the format "H:i:s" as accepted by PHP's buil= t-in date() function.

Example:

"12:14:56"

Hash format


Value in hash format is an integer representing a number of second= s since the beginning of a day.

Example:

36000

Validation


This FieldType does not perform validation of the input value.

Settings


The field definition of this FieldType can be configured with several op= tions:

Name Type Default value Description
useSeconds
boolean false Used to control displaying of seco= nds in the output.
defaultType
Type::DEFAULT_EMPTY
Type::= DEFAULT_CURRENT_TIME
Type::DEFAULT_EMPTY
The constant used here defines def= ault input value when using administration interface.
Time FieldType example settings
=20
use eZ\Publish\Core\FieldType\Time\Type;

$settings =3D array(
=09"defaultType" =3D> DateAndTime::DEFAULT_EMPTY
);
=20
------=_Part_3923_493535240.1485855900403--