Skip to content
bbminfo – Learn from Scratch
Subjects Code examples Library reference
Computer Programming Python Java C++ C Go PHP Kotlin Ruby R Scala Groovy

Tutorial menu

Subjects

Computer Programming MathsPlanned ChemistryPlanned

Lesson contents

Programming resources

All languages Code examples Library reference

Programming languages

Python Java C++ C Go PHP Kotlin Ruby R Scala Groovy
Tutorials/Computer Programming/PHP/Library/Dates and time

PHP dates and time

Calculate a delivery date or count nights between bookings.

DateTimeImmutable::diffDateTimeImmutable::formatDateTimeImmutable::createFromFormat
  • DateTimeImmutable::createFromFormatReject a date that the parser normalizes
  • DateTimeImmutable::diffCount nights in a leap-year hotel stay
  • DateTimeImmutable::formatPrint a consistent date on a receipt
  • DateTimeImmutable::modifyCalculate a delivery date across leap day

All PHP library sections

PHP tutorials

Environment setup› Library reference› Data structures› Code examples›
Advertisements
bbminfo – Learn from Scratch
© 2026 bbminfoArtwork creditsPrivacy policy