CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 MSSQL + PHP4 + Debian Linux --> how to set DB datetime format?

Print topic Send  topic

Author Message
Trisiana
Posted: 04/19/2004, 2:05 AM

Hello, I am hosting my PHP/MSSQL ccs application to an Debian Linux with
installed free TDS (www.freetds.org). I have difficulty with MSSQL date/time
field. PHP did not recognized the date/time field and return blank. I try to
set the data type to text and it return like this Mar 20 2004 12:00AM

Is anyone know how to set the Debian Linux webserver to return the correct
db format like yyyy-mm-dd HH:nn:ss?

.p-dog
Posted: 06/18/2004, 10:48 AM

Try the ini setting mssql.datetimeconvert=0. This prevents php from translating the date into the server's local format.

ini_set("mssql.datetimeconvert", "0");

If your php version is older than ~4.23, use the MSSQL CONVERT function instead.

http://msdn.microsoft.com/library/en-us/tsqlref/ts_ca-co_2f3o.asp

Enjoy!
-Matt
bcbig
Posted: 07/30/2004, 12:49 PM

I had this exact problem running IIS as server and this solution worked perfectly. Many thanks.
anon
Posted: 07/31/2004, 2:16 PM

I've had this problem too but don't have authorization to change the php.ini on our host, not even using:

ini_set("mssql.datetimeconvert", "0");

Is there any other way to do this without eliminating the use of Date functions built into CCS?

Please help!
Damian
Posted: 08/03/2004, 6:24 AM

http://www.google.com/search?hl=en&lr=&ie=UTF-8&q=htaccess&btnG=Search

Use the .htaccess file...


"anon" <anon@forum.codecharge> wrote in message
news:5410c0c22cf6da@news.codecharge.com...
> I've had this problem too but don't have authorization to change the
php.ini on
> our host, not even using:
>
>
ini_set("mssql.datetimeconvert", "0");
>
> Is there any other way to do this without eliminating the use of Date
functions
> built into CCS?
>
> Please help!
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

Last Hero
Posted: 08/04/2004, 1:10 AM

Try set Date Format for connection as: mmm d yyyy HH:nnAM/PM
or mmm d yyyy H:nnAM/PM if some dates have 1-digits hour(Mar 20 2004 2:00AM)

anon
Posted: 08/09/2004, 11:40 AM

Since I don't have access to edit the php.ini (nor .htaccess because i'm running IIS), I had to use the MSSQL CONVERT function recommended by .p-dog.

Rather than using CONVERT to return the specific date format I needed for my page, I used:
CONVERT(varchar(20), date_time, 120) as date_time
in my SQL statement to return a format the built-in CCS Date Functions could recognize. All the pages that were previously built using the built-in date functions work properly just by changing the SQL statement.

It seems to be an effective work-around if you're on a shared box and have limited control over the configuration.

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.