|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-02-04 19:28 UTC] robert dot johnson at icap dot com
[2009-02-04 19:42 UTC] derick@php.net
[2009-02-04 19:42 UTC] derick@php.net
[2009-02-04 19:49 UTC] derick@php.net
[2009-05-10 17:38 UTC] jani@php.net
[2016-08-07 09:52 UTC] cmb@php.net
-Status: Assigned
+Status: Duplicate
[2016-08-07 09:52 UTC] cmb@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 11:00:01 2025 UTC |
Description: ------------ I changed locale to Germany, created a datetime with microseconds, formatted the date, and the microseconds were zero. This first appeared when SQL 2005 driver showed no microseconds for German users of my site. The code is a simple test to show it's not caused by the SQL Server driver. Reproduce code: --------------- $robert = new DateTime('2009-02-04 15:55:25.321'); $robertf = $robert->format(CLocale::DateTimeFormatFull); echo $robertf . "\r\n"; $robloc = setlocale(LC_ALL, 'German_Germany.1252'); echo $robloc . "\r\n"; $robert = new DateTime('2009-02-04 15:55:25.321'); $robertf = $robert->format(CLocale::DateTimeFormatFull); echo $robertf . "\r\n"; $robloc = setlocale(LC_ALL, 'English_uk.1252'); echo $robloc . "\r\n"; $robert = new DateTime('2009-02-04 15:55:25.321'); $robertf = $robert->format(CLocale::DateTimeFormatFull); echo $robertf . "\r\n";; Expected result: ---------------- 04/02/2009 15:55:25.321000 German_Germany.1252 04/02/2009 15:55:25.321000 English_United Kingdom.1252 04/02/2009 15:55:25.321000 Actual result: -------------- 04/02/2009 15:55:25.321000 German_Germany.1252 04/02/2009 15:55:25.000000 English_United Kingdom.1252 04/02/2009 15:55:25.321000