JQuery has a function for setting minutes, hours, etc. Is this also in PHP?
I have:
$date = new DateTime();
and
$min = '23';
I would like to set the minutes to $ min in $ date.
Maybe? If so, how?
You are looking for DateTime::setTime .
DateTime::setTime
If you want to change the minutes and leave the watch intact, you will of course have to pass the current value of the clock as the first parameter. Get this with $dateTime->format('G') .
$dateTime->format('G')
DateTime::modify() will be the beginning. Just read the documentation found here
DateTime::modify()
Source: https://habr.com/ru/post/906162/More articles:https://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/906157/prevent-jenkins-from-installing-artifact-to-local-maven-repository&usg=ALkJrhiPOh_zMILX4wSF5k8yol6aSL82wQWhy aren't newlines printed in this Perl code? - perlCan I force my own short circuit in a method call? - c #IsNullOrEmpty with object - c #Equivalent functions producing different interpreter results - lambdaData transfer isochronous data transfer via USB - androidAndroid app "Device or resource busy" when accessing a USB device via JNA - javaCompilation with Power Tools for OpenXML: "OutputTypeAttribute" not found - c #How to document a makefile? - makefileDoes the duration of the sequence get a continuous operation? - scalaAll Articles