sivanath.nagendran Posted December 7, 2006 Share Posted December 7, 2006 Hi I am newbie to MySQL. I had done one project in that project I stored IN&Out time into MySQL database field type is timestamp. That field like this 07-06-2006 14.25.29. Now what I need, that is If is it possible for divide into two part date and time from timestamp field ? Is it possible?thanks for your helpBySivanath.N Link to comment https://forums.phpfreaks.com/topic/29843-timestamp-help/ Share on other sites More sharing options...
artacus Posted December 7, 2006 Share Posted December 7, 2006 AbsolutelySELECT DATE(myTimestamp) AS myDate, TIME(myTimestamp) AS myTimeor DATE_FORMAT(myTimestamp, '%Y-%m-%d') AS myDate check out the date/time section of the mysql manual for all of your options. Link to comment https://forums.phpfreaks.com/topic/29843-timestamp-help/#findComment-137101 Share on other sites More sharing options...
fenway Posted December 9, 2006 Share Posted December 9, 2006 Sure, but why would you want to? Link to comment https://forums.phpfreaks.com/topic/29843-timestamp-help/#findComment-137895 Share on other sites More sharing options...
sivanath.nagendran Posted December 12, 2006 Author Share Posted December 12, 2006 Hi Fenway Because I am doing one project. In my project I need to seperately display the particlar date and time., thats why i am asking. Why you asking this? Is This not a normal (Good) question?send replyBySivanath.N Link to comment https://forums.phpfreaks.com/topic/29843-timestamp-help/#findComment-139975 Share on other sites More sharing options...
artacus Posted December 13, 2006 Share Posted December 13, 2006 >> Is This not a normal (Good) question?No, he's saying you'd be better off keeping it as a datetime field and just pulling the date and/or time pieces when you need them using DATE_FORMAT() or similar function. Link to comment https://forums.phpfreaks.com/topic/29843-timestamp-help/#findComment-140062 Share on other sites More sharing options...
fenway Posted December 15, 2006 Share Posted December 15, 2006 [quote author=artacus link=topic=117764.msg483726#msg483726 date=1165974908]>> Is This not a normal (Good) question?No, he's saying you'd be better off keeping it as a datetime field and just pulling the date and/or time pieces when you need them using DATE_FORMAT() or similar function.[/quote]Correct -- you don't store information in a DB for display purposes. Link to comment https://forums.phpfreaks.com/topic/29843-timestamp-help/#findComment-142100 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.