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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: tom at go2net dot com
New email:
PHP Version: OS:

 

 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2020 The PHP Group
All rights reserved.
Last updated: Wed Jan 29 08:01:25 2020 UTC