Skip to main content

Dates and Times

  • Chapter
  • First Online:
PHP and MySQL Recipes
  • 2604 Accesses

Abstract

PHP does not have a variable type dedicated to storing date or time values. Instead, integers are used to indicate the number of seconds before or since January 1st, 1970, also called Epoc. When dates and times are treated as a single value they are called a timestamp. The use of integers makes it easy to calculate differences between two timestamps as ordinary math applies.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 44.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 59.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2016 Frank M. Kromann

About this chapter

Cite this chapter

Kromann, F.M. (2016). Dates and Times. In: PHP and MySQL Recipes. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-0605-8_5

Download citation

Publish with us

Policies and ethics