Php to read mssql time display format solution. We know that mssql does not use time as php does. the generated time format DateTime is incorrect, the following code is used to copy the code while ($ rowsqlsrv_fetch_array we know that mssql does not
Comparison between MYSQL and MSSQL and MYSQLMSSQL
Recently, I was modifying the MSSQL statements related to a company's product to statements that can be executed on MYSQL.
L Advantage Analysis:
MYSQL is short, easy to use, easy to use, and free
Before using PHP 5.2.x because it is already configured, so the read datetime format output is similar: 2008/12/12, after upgrading the system to read data as a datetime data object, search the site found the following:MSSQL defaults to the system
We know that mssql does not use time as php does. The generated time format DateTime is incorrect, as shown below:
The Code is as follows:
Copy code
While ($ row = sqlsrv_fetch_array ($ result, SQLSRV_FETCH_ASSOC )){Print_r ($
It is difficult to compare the date and time of access. I tried it several times before and it was not very successful,You can only change the date field to the character type for character comparison,Now I met again. After repeated tests, I finally
View Articles
How to use date and calender classes in Java 2009-10-04 20:49Date and calendar are classes that provide time processing in the Java class Library, and because dates occupy an important place in the application of
SetAnsi_nulls onSetQuoted_identifier onGoALTER FUNCTION [dbo].[Ufn_getdateofweek](@Date Datetime)RETURNS nchar(1) asBEGIN DECLARE @returnValue nchar(1); SET @returnvalue = Case DatePart(DW,@Date) when 2 Then 'a'
The code is as follows
Copy Code
while ($row = Sqlsrv_fetch_array ($result, SQLSRV_FETCH_ASSOC)){Print_r ($row [' datetime ']);//This field is a time format for MSSQL}The result isDateTime Object([Date] => 2011-10-20
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.