date now php
date('Y-m-d H:i:s')
date now php
date("Y-m-d H:i:s");
php now
// 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'));
how to set date in php
// 1. create a date instance
$date = new DateTime;
// 2. set the date using the setDate(year, month, date) method on the
// $date instance
$date->setDate(1999,02,19);
date now php
echo date('c');
// 2015-07-27T00:00:00+02:00
phph date
<?php
// Définit le fuseau horaire par défaut à utiliser. Disponible depuis PHP 5.1
date_default_timezone_set('UTC');
// Affichage de quelque chose comme : Monday
echo date("l");
// Affichage de quelque chose comme : Monday 8th of August 2005 03:12:46 PM
echo date('l jS \of F Y h:i:s A');
// Affiche : July 1, 2000 is on a Saturday
echo "July 1, 2000 is on a " . date("l", mktime(0, 0, 0, 7, 1, 2000));
/* utilise les constantes dans le paramètre format */
// Affichage de quelque chose comme : Wed, 25 Sep 2013 15:28:57 -0700
echo date(DATE_RFC2822);
// Affichage de quelque chose comme : 2000-07-01T00:00:00+00:00
echo date(DATE_ATOM, mktime(0, 0, 0, 7, 1, 2000));
?>
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us