By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,703 Members | 1,128 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,703 IT Pros & Developers. It's quick & easy.

how to convert time from (yyyy-mm-dd hh:mm:ss) this format to simply (hh:mm:ss) ?

P: 127
i have stored the user break times in the database...

user break start time and end time...

the timestamp stored in the database in the (yyyy-mm-dd hh:mm:ss) format in the database...

when i retrieve the time from the database the time will be like this...
2010-10-26 10:00:39

but i want only the time part. i.e 10:00:39
i dont want the date..

how to get only the time from the database? plz help?
Oct 26 '10 #1
Share this Question
Share on Google+
2 Replies

P: n/a

SELECT TIME(timefield) AS time FROM table WHERE somethingsomething
Oct 26 '10 #2

Expert 100+
P: 1,044
Or, since you're asking in the PHP forum:
Expand|Select|Wrap|Line Numbers
  1. echo date('H:i:s', strtotime($mysql_date));
Oct 26 '10 #3

Post your reply

Sign in to post your reply or Sign up for a free account.