Question : How would I format the return data from a mssql query

Can anyone tell me if I can or can not...and how, "LOL" I can re-format the return date and time that shows from the query below. It returns this "2010-07-09 12:00:00.000" and I need it to look more like 07-09-2010 12:00 PM or even if it would just drom the extra :00.000 would work better and ez to read.
 
1:
2:
3:
$sql="SELECT Distinct orderheader.ord_number, orderheader.ord_refnum, orderheader.mov_number, orderheader.ord_tractor, orderheader.ord_hdrnumber, stops.stp_type, stops.cmp_name, company.cmp_address1, company.cty_nmstct, stops.cmp_id, stops.stp_phonenumber, stops.stp_schdtearliest, stops.stp_reftype, stops.stp_refnum, stops.stp_weight, stops.stp_weightunit, stops.stp_count, stops.stp_countunit
FROM orderheader, stops, company WHERE orderheader.ord_hdrnumber = stops.ord_hdrnumber AND company.cmp_id = stops.cmp_id AND orderheader.mov_number='$unit' ORDER BY stops.stp_schdtearliest ASC";
$rs=odbc_exec($conn,$sql);

Answer : How would I format the return data from a mssql query

Try this:


1:
2:
3:
4:
Change:
$stp_schdtearliest=odbc_result($rs,"stp_schdtearliest");
to
$stp_schdtearliest=date("m-d-Y H:i A", strtotime(odbc_result($rs,"stp_schdtearliest")));
Random Solutions  
 
programming4us programming4us