php now() function Code Answer’s

The Now() function returns the current timestamp in seconds since midnight, January 1, 1970, UTC (Coordinated Universal Time). This is useful for displaying data that is relative to that time. The following example shows how you can use the now() function to check whether your computer's clock is running correctly.

php get current date and time

By GrepperGrepper on Oct 30, 2019
$today = date("F j, Y, g:i a");   // October 30, 2019, 10:42 pm
$today = date("D M j G:i:s T Y"); // Wed Oct 30 22:42:18 UTC 2019
$today = date("Y-m-d H:i:s");     // 2019-10-30 22:42:18(MySQL DATETIME format)

Add Comment

16

date now php

By Attractive AlligatorAttractive Alligator on Jul 11, 2020
date('Y-m-d H:i:s')

Add Comment

6

php date timestamp now

By Alive AntelopeAlive Antelope on Oct 07, 2020
//Get current date time in PHP

// Simply:
$date = date('Y-m-d H:i:s');

// Or:
$date = date('Y/m/d H:i:s');

// This would return the date in the following formats respectively:
$date = '2012-03-06 17:33:07';
// Or
$date = '2012/03/06 17:33:07';

/** 
 * This time is based on the default server time zone.
 * If you want the date in a different time zone,
 * say if you come from Nairobi, Kenya like I do, you can set
 * the time zone to Nairobi as shown below.
 */

date_default_timezone_set('Africa/Nairobi');

// Then call the date functions
$date = date('Y-m-d H:i:s');
// Or
$date = date('Y/m/d H:i:s');

// date_default_timezone_set() function is however
// supported by PHP version 5.1.0 or above.

Source: stackoverflow.com

Add Comment

3

php format date

By Xenophobic XenomorphXenophobic Xenomorph on Apr 14, 2020
<?php
  // To change the format of an existing date
  $old_date_format = "20/03/1999";
  $new_data_format = date("Y-m-d H:i:s", strtotime($old_date_format));

Add Comment

5

php now

By EnrybiEnrybi on May 20, 2021
// In my case I want to print to log my zone time (Rome GMT +2)
// without changing the default timezone
// Add +2 hours respect to php time
$new_time = date("Y-m-d H:i:s", strtotime('+2 hours'));

Add Comment

1

date now php

By ollakallaollakalla on Oct 21, 2020
date("Y-m-d H:i:s");

Source: stackoverflow.com

Add Comment

1

The Now() function can be used in two ways:Returning a string containing the current timeReturning a numeric value representing the current time

PHP answers related to "php now"

View All PHP queries

PHP queries related to "php now"

php now ?? ' ' operator in php laravel php artisan app:name in laravel 6 php artisan make:auth laravel 8 not working php artisan ui:auth laravel 7 php cache clear in laravel php extensions for laravel php laravel dump php laravel return json response php laravel rount price to 99 php run server laravel php unit testing laravel remove index.php laravel in linux server cheque print in php codeigniter install php ubuntu 20.04 php enable module php display errors php console log php for loop php sha256 php in array php uppercase each word php uppercase first letter php is numeric simple localhost php php include once inside a function? php if else how to convert array to string with commas in php curl php example php string to date php string functions Line : 83 -- syntax error, unexpected end of file php php file_put_contents pagination in php php print_r php check if type is mysqli_result saber value ao escolher combobox php Best Code Beautifier tools for php Uncaught TypeError: Argument 1 passed to NotORM_Result::update() php slim array shift php php PDO database connection set default php version in ubuntu php time() spread operator php Check if string starts with php radio button in php form increase PHP Memory login.php php class https//:localhost/phpmyadmin/index.php php get session variable from table Convert string to lowercase in php parseint php Php array length date to string php php reverse shell Mkdir permission denied php Php += Move uploaded file in php Php mysqli fetch assoc Php trying to get property of non-object Php strtolower date format in php array to object in php Send email php smtp hostinger Show all errors in php binemon to php password and confirm password validation in php php int to strin php timeout Php localhost str_pad_left in php php htmlspecialchars php redirect to page

Browse Other Code Languages

CodeProZone