This seems to work, although it seems illogical that http://us.php.net/date documents the microsecond specifier yet doesn’t really support it:
function getTimestamp()
{
return date("Y-m-d\TH:i:s") . substr((string)microtime(), 1, 8);
}
More Related Contents:
- PHP DateTime supported formats
- Display which day it is? sunday or monday “php coding”? [closed]
- PHP 01/01/1970 Issues with Date Fields
- Convert one date format into another in PHP
- PHP: Return all dates between two dates in an array [duplicate]
- Finding the number of days between two dates
- Why can’t I access DateTime->date in PHP’s DateTime class?
- How do I get the current date and time in PHP?
- Converting string to Date and DateTime
- How we can add two date intervals in PHP
- The first day of the current month in php using date_modify as DateTime object
- How to find day of week in php in a specific timezone
- Get the date of next monday, tuesday, etc
- Find Month difference in php? [duplicate]
- PHP Adding 15 minutes to Time value
- How to separate DATE and TIME from DATETIME in MySQL?
- PHP order array by date? [duplicate]
- PHP DateTime() class, change first day of the week to Monday
- php: setting a timezone by UTC offset
- PHP DateTime round up to nearest 10 minutes
- PHP: strtotime is returning false for a future date?
- How to render a DateTime object in a Twig template
- Date in a URL dd/mm/yyyy
- print_r() adds properties to DateTime objects [duplicate]
- How to update timezonedb in PHP (updating timezones info)?
- adding 30 minutes to datetime php/mysql
- Get Start and End Days for a Given Week in PHP
- Get a PHP DateTime difference in days, considering midnight as a day change
- How to convert UTC datetime to another timezone?
- Get date for monday and friday for the current week (PHP)