Answer the question
In order to leave comments, you need to log in
How in js / jquery to compare the strings "date time" for more - less?
There is a line like : var str = '30.10.2015 19:53';
In php, I compare such things by translating into a timestamp:
$stamp1 = My::getTimeStamp(str);
static function getTimeStamp($dateFormat)
{
$dateTime = explode(' ',$dateFormat);
$date = $dateTime[0];
$time = $dateTime[1];
$dMY = explode('.',$date);
$hm = explode(':',$time);
$day = $dMY[0];
$month = $dMY[1];
$year = $dMY[2];
$hour = $hm[0];
$minutes = $hm[1];
return mktime($hour, $minutes, 0, $month, $day, $year);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question