Rozdíly mezi datovými formáty

Verze pro tiskVerze pro tisk
Modul: 

https://www.drupal.org/node/1455576

Date

  • Called datetime in the column type in the database table field_config.
  • This format type is recommended for most installs because it takes advantage of the database's date handling functions without any conversion, which means faster queries.
  • Stores the date in the database's native date format (YYYY-MM-DD HH:MM:SS).
  • The data is in a human-readable form.
  • You can use it for incomplete dates, i.e. only a year or only a year and a month, and pad the other values with zeros, so it does not appear to be any more precise than it really is.

Date (ISO Format)

  • Called date in the column type in the database table field_config.
  • Stores the date in an ISO format (YYYY-MM-DDTHH:MM:SS).
  • The data is in a human-readable form.
  • You can use it for incomplete dates, i.e. only a year or only a year and a month, and pad the other values with zeros, so it does not appear to be any more precise than it really is.
  • It is a format that is internationally-recognized, and it is used as-is on many web sites and in many applications.

Date (Unix Timestamp)

  • Called datestamp in the column type in the database table field_config.
  • Stores the date as an integer.
  • Takes up less room in the database because it's smaller.
  • Often easier to use for date calculations because you can increase or decrease it just by adding or subtracting seconds.
  • It is the format used by php date functions.
  • It must be filled with a complete date -- year, month, day, hour, minute, second, so you sometimes have to arbitrarily set some of these values even if they are not applicable.