Search Results
DateTimeImmutable::sub () - Subtracts an amount of days, months, years, hours, minutes and seconds DateTime::sub () - Subtracts an amount of days, months, years, hours, minutes and seconds from a DateTime object
Mar 15, 2013 · Definition and Usage The date_sub () function subtracts some days, months, years, hours, minutes, and seconds from a date.
- Required. Specifies a DateInterval object
Jul 1, 2018 · The date_sub () function is an inbuilt function in PHP that is used to subtract days, months, years, hours, minutes, and seconds from given date. This function returns a DateTime object on success and FALSE on failure.
Return Values PHP date_sub () function returns a DateTime object, subtracting the given interval from it. In case of failure, this function returns the boolean value false.
As any developer knows, working with dates can be a challenging task. Fortunately, PHP has a built-in feature that makes date calculations easier than ever.
Dans ce tutoriel, vous apprendrez à utiliser la fonction date_sub () en PHP pour soustraire une durée à une date. Vous découvrirez la syntaxe de la fonction, les paramètres qu'elle prend et quelques exemples d'utilisation.
People also ask
What does the PHP date\_sub() function do?
What is date_sub() function in PHP?
How to subtract 40 days from a date in PHP?
How to use the date\_sub() function?
Jul 15, 2023 · The date_sub() function subtracts a number of days, months, years, hours, minutes and seconds from a given date.
