php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #861 Inconsistent date format between solaris and linux (+ patch)
Submitted: 1998-10-20 16:35 UTC Modified: 1998-11-03 21:42 UTC
From: tom at go2net dot com Assigned:
Status: Closed Package: Sybase (dblib) related
PHP Version: 3.0.5 OS: Linux
Private report: No CVE-ID: None
 [1998-10-20 16:35 UTC] tom at go2net dot com
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)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1998-11-03 21:42 UTC] tommay
Since this was my bug, I saw fit to fix it in the suggested manner :-)

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Oct 15 19:01:26 2024 UTC