Can you help me to see why the time value retrieved from the SQL database is incorrect?
Source: Internet
Author: User
Can you help me see why the time value retrieved from the SQL database is incorrect? My Environment: Windows2008 (32-bit) + Apache2.2.21 + PHP5.2.17 + SQLServer2000 now has a table in SQLServer with a column of The datetime type, the value is "2012-can you help me see why the time value retrieved from the SQL database is incorrect?
My environment:
Windows 2008 (32-bit) + Apache2.2.21 + PHP 5.2.17 + SQL Server 2000
Now there is a table in SQL Server with a column of The datetime type, and the value is "10:00:00"
The read data is shown as "2012 10:00, January 1, May 7", and I tested it with strlen to be 17 characters in length.
What's going on ??
Thank you.
------ Solution --------------------
How to get it? Try conversion.
------ Solution --------------------
Set the display format when reading the data.
------ Solution --------------------
How do I write SQL statements?
------ Solution --------------------
In this way, what format is read? Try convert () conversion.
------ Solution --------------------
Convert (char, your date field, 120)
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service