Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get date out of sql server datetime

Tags:

php

sql-server

I need to get the date from a SQL Server datetime, and then format the date. (i.e. 01-Jan-2000) I'm using PHP.

currently, SQL is returning 2009-02-13 22:00:00.000.

like image 941
Khurram Ijaz Avatar asked Dec 04 '22 23:12

Khurram Ijaz


1 Answers

echo date('d-M-Y', strtotime($datetime_from_db));
like image 100
Dan Grossman Avatar answered Dec 07 '22 11:12

Dan Grossman