EasyUI Forum
May 15, 2024, 08:46:06 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Time format in grid  (Read 2478 times)
Steve2106
Newbie
*
Posts: 20


View Profile Email
« on: June 04, 2020, 12:58:16 PM »

Hi There,

Can someone help me with the format of a time field in an easyui grid. it is showing as "20:23:09" and I would like to just keep the hours and minutes "20:23" how can I do that?

Thanks for your help.

Best Regards,

Steve.
Logged
Steve2106
Newbie
*
Posts: 20


View Profile Email
« Reply #1 on: June 06, 2020, 09:43:06 AM »

Hi There,

I can get the code below to work in MySqladmin but when I add it to a mysql call in EasyUI it does not work. More than likely a syntax error.

SELECT certname,
DATE_FORMAT(TIME1,'%k:%i') AS 'Time1',
DATE_FORMAT(TIME2,'%k:%i') AS 'Time2',
DATE_FORMAT(TIME3,'%k:%i') AS 'Time3',
DATE_FORMAT(TIME4,'%k:%i') AS 'Time4'
FROM order

Below is the code I have in my EasyUI index.php
<th field="time1" width="70" align="center">Time 1</th>  but how do I add the, DATE_FORMAT(TIME1,'%k:%i') AS 'Time1', bit

Does anyone know the correct syntax or have any idea why it doesn't work?

Best Regards,

Steve.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!