datetime_date_default_time

datetime_date_default_time($date)

Sets a consistent time on a date without time.

The default time for a date without time can be anything, so long as it is consistently applied. If we use noon, dates in most timezones will have the same value for in both the local timezone and UTC.

Parameters

$date:

File

core/modules/datetime/datetime.module, line 54
Field hooks to implement a simple datetime field.

Code

function datetime_date_default_time($date) {
  $date->setTime(12, 0, 0);
}
doc_Drupal
2016-10-29 09:01:05
Comments
Leave a Comment

Please login to continue.