Answers for "mysql change format datetime"

SQL
1

mysql pretty date format

DATE_FORMAT(NOW(),'%M %e, %Y @ %h:%i %p') 
#Format is 'June 10, 2014 @ 06:52 PM'
Posted by: Guest on November-27-2019
1

format time mysql

-- use DATE_FORMAT with %H %i
-- SELECT DATE_FORMAT(MemberBookFacility.time, '%H:%i')
"45": "09:00",
"24": "10:00",
"42": "11:00",
"48": "12:00",

-- ONcakephp must use below format
$this->virtualFields['time'] = "DATE_FORMAT(MemberBookFacility.time, '%H:%i')";	// using this for use concat
	
		return $this->find('list', array(
          'conditions' => $conditions,
          'fields' => array(
            'MemberBookFacility.id', 
            'time',
          ),
          'order' => array(
            'MemberBookFacility.time ASC',
          ),
        ));
Posted by: Guest on October-27-2020

Code answers related to "SQL"

Browse Popular Code Answers by Language