About 1,790,000 results
Open links in new tab
  1. How do I get the current date and time in PHP? - Stack Overflow

    Jan 23, 2009 · The time would go by your server time. An easy workaround for this is to manually set the timezone by using date_default_timezone_set before the date() or time() functions are …

  2. Convert timestamp to readable date/time PHP - Stack Overflow

    I have a timestamp stored in a session (1299446702). How can I convert that to a readable date/time in PHP? I have tried srttotime, etc. to no avail.

  3. How to convert date to timestamp in PHP? - Stack Overflow

    Sep 22, 2008 · Please be careful about time/zone if you set it to save dates in database, as I got an issue when I compared dates from mysql that converted to timestamp using strtotime. you …

  4. php - Converting string to Date and DateTime - Stack Overflow

    376 If I have a PHP string in the format of mm-dd-YYYY (for example, 10-16-2003), how do I properly convert that to a Date and then a DateTime in the format of YYYY-mm-dd? The only …

  5. How to calculate the difference between two dates using PHP?

    Mar 24, 2009 · 593 Use this for legacy code (PHP < 5.3; Jun 2009). For up to date solution see jurka s' answer above. You can use strtotime () to convert two dates to unix time and then …

  6. Convert one date format into another in PHP - Stack Overflow

    The second parameter to date() needs to be a proper timestamp (seconds since January 1, 1970). You are passing a string, which date () can't recognize. You can use strtotime () to …

  7. PHP date () format when inserting into datetime in MySQL

    Feb 7, 2010 · What is the correct format to pass to the date() function in PHP if I want to insert the result into a MySQL datetime type column? I've been trying date('Y-M-D G:i:s') but that just …

  8. php - Getting date format m-d-Y H:i:s.u from milliseconds - Stack …

    Jul 28, 2013 · Uses date to format the milliseconds into a date time string that DateTime can understand. DateTime() can then allow you to modify the time zone you are in, but ensure that …

  9. How can I get the current time in milliseconds in PHP?

    Long answer: If you want an equilvalent function of time() in milliseconds first you have to consider that as time() returns the number of seconds elapsed since the "epoch time" …

  10. php - How to get date and time from server - Stack Overflow

    <?php echo date("r == e"); ?> Why this is happening and what changes I have to do in my code so that I can get proper server time.