Different Query Result in SQL Server 2005

I have a table in SQL Server 2005, and it has column period (datetime).

The value of the column period is 8/7/2009 12:00:00 AM, when I query using php script it give me output Aug 7 2009 12:00AM.

Why it's not 8/7/2009 12:00:00 AM ???

Thank you

Answers


Your question reads like this:

The value of the column period is { a date, year 2009 month August day 7th at 12:00 AM} When I query using php script it give me output "Aug 7 2009 12:00AM", i.e. one representation of the date. Why it's not "8/7/2009 12:00:00 AM", i.e. another representation of the date

A datetime represents a point in time. It is a specific concept. You are comparing two separate representations of the datetime, or in other words, two ways of formatting the datetime value as a textual string.

The issue you are trying to solve is then, "How do I format a datetime as a string in PHP"? For which the answer would be to refer to the date_format (aka DateTime::format) function

To wit, the display specifier for 8/7/2009 12:00:00 AM is n/j/Y h:i:s A.


Need Your Help

Transform values without VBA but with Index and Match

excel

I'm trying to find a solution without macros in excel for following problem:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.