Bug #861: Inconsistent date format between solaris and linux (+ patch)

From: Date: Tue, 20 Oct 1998 20:35:32 +0000
Subject: Bug #861: Inconsistent date format between solaris and linux (+ patch)
Groups: php.dev 
Request: Send a blank email to php-dev+get-1924@lists.php.net to get a copy of this message
From: tom@go2net.com Operating system: Linux PHP version: 3.0.5 PHP Bug Type: Sybase related Bug description: Inconsistent date format between solaris and linux (+ patch) 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) -- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net For help: php-dev-help@lists.php.net

« previous php.dev (#1924) next »