|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[1998-11-03 21:42 UTC] tommay
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 08:00:01 2025 UTC |
On Solaris 2.6 using the sybase ct-lib from sybase 11.5.1, datetime values fetched from the database look like "Oct 20 1998 4:22PM". On linux with the 11.0.3.3 ct-lib recently released by sybase, they look like "20/10/98". Here is a patch to explicitly set the format to the former. It works with the two configurations I mentioned. Alternatively, perhaps a new function could be added to set the date format. --- php-3.0.5/functions/sybase-ct.c.0 Sun Oct 4 17:23:02 1998 +++ php-3.0.5/functions/sybase-ct.c Tue Oct 20 12:58:50 1998 @@ -189,6 +189,15 @@ if (ct_callback(context, NULL, CS_SET, CS_CLIENTMSG_CB, (CS_VOID *)_client_message_handler)!=CS_SUCCEED) { php3_error(E_WARNING,"Sybase: Unable to set client message handler"); } + + /* Set datetime conversion format to "October 20 1998 4:22PM" */ + + { + CS_INT dt_convfmt = CS_DATES_SHORT; + if (cs_dt_info(context, CS_SET, NULL, CS_DT_CONVFMT, CS_UNUSED, &dt_convfmt, sizeof(dt_convfmt), NULL)!=CS_SUCCEED) { + php3_error(E_WARNING,"Sybase: Unable to set datetime conversion format"); + } + } if (cfg_get_long("sybct.allow_persistent",&php3_sybct_module.allow_persistent)==FAILURE) { That's all, Tom. (who's kind of annoyed about having to send a patch through a squinky browser interface instead of using e-mail)