| 
        php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             
             [2004-11-25 17:36 UTC] jap1968 at yahoo dot es
  [2004-12-22 05:42 UTC] sniper@php.net
  [2004-12-29 18:33 UTC] sniper@php.net
  | 
    |||||||||||||||||||||||||||||||||||||
            
                 
                Copyright © 2001-2025 The PHP GroupAll rights reserved.  | 
        Last updated: Tue Nov 04 07:00:01 2025 UTC | 
Description: ------------ When using a LC_TIME locale which do represent time in 0..24h manner in spite of using AM/PM, wrong results are obtained. Results are always in the range 0..11, so if the time corresponds to a PM hour, the returned result is wrong. It does not correspond with the real value stored in the database! Reproduce code: --------------- // Asking a MS_SQLServer through FreeTDS + Sybase functions $linkBD = sybase_connect("SGBD", "user", "pass"); sybase_select_db("BD", $linkBD); $query = "select fecha from table"; /* RIGHT */ setlocale (LC_TIME, "en_US"); // Returns correct time $res = sybase_query($query, $linkBD); if ($fila = sybase_fetch_array($res)) { $fecha = $fila['fecha']; echo 'en_US'.$fecha; } /* WRONG */ setlocale (LC_TIME, "es_ES"); // Returns wrong time $res = sybase_query($query, $linkBD); if ($fila = sybase_fetch_array($res)) { $fecha = $fila['fecha']; echo 'es_ES'.$fecha; } sybase_close($linkBD); Expected result: ---------------- en_US:NOV 25 2004 01:00PM es_ES:nov 25 2004 01:00 Actual result: -------------- en_US:NOV 25 2004 01:00PM es_ES:nov 25 2004 13:00