php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #65658 microtime is locale aware and not documented as such.
Submitted: 2013-09-12 11:01 UTC Modified: 2013-09-12 13:22 UTC
From: RQuadling at GMail dot com Assigned:
Status: Closed Package: Documentation problem
PHP Version: 5.4.19 OS: n/a
Private report: No CVE-ID: None
 [2013-09-12 11:01 UTC] RQuadling at GMail dot com
Description:
------------
microtime(true) returns a locale aware string. This isn't documented.

Test script:
---------------
<?php
echo 'No locale loaded     : ', microtime(True), PHP_EOL;
setlocale(LC_ALL, 'fr_FR.UTF-8');
echo 'France locale loaded : ', microtime(True), PHP_EOL;


Expected result:
----------------
No locale loaded     : 1378983437.9622
France locale loaded : 1378983437,9626


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-09-12 11:09 UTC] leight+bugs dot php at gmail dot com
microtime() returns a double, not a string. This is not a bug, Printing out a 
double type will return it in a locale specific format.
 [2013-09-12 11:12 UTC] leight+bugs dot php at gmail dot com
Sorry I should have said, using microtime with $get_as_float = true returns a 
float/double type, instead of a string.
 [2013-09-12 13:22 UTC] RQuadling at GMail dot com
-Status: Open +Status: Closed
 [2013-09-12 13:22 UTC] RQuadling at GMail dot com
Not a bug. Me being stupid.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jun 01 02:01:32 2024 UTC