Insert date time to Mysql database in text Format

Create ” date_posted “database field type as text or varchar

<?php 
if (isset($_POST['comment'])){
$comment_content = $_POST['comment_content'];
$post_id=$_POST['id'];
mysql_query("insert into comment (content,date_posted,user_id,post_id) values ('$comment_content','".strtotime(date("Y-m-d h:i:sa"))."','$user_id','$post_id')") or die (mysql_error());
header('location:home.php');
}
?>

Posted in PHP