Stuck PHP date () shows same day / time

I am currently having the strangest problem. I have the following PHP code which should display the current day and date, but it gives me "Mon, Dec 12, 2010", no matter what day it is.

<?php echo date('D, M n, Y'); ?>

if i run

<?php echo date(); ?>

It does not return anything.

I am running PHP version 5.2.13 via fastcgi on lighttpd (managed by Kloxo). My time zone is correctly installed on the server (CentOS 5.5).

I do not know if this is a server problem or php.ini problem, so I post here. Move if necessary.

+3
source share
3 answers

'D, M n, Y' " , , , ". , , - , 'n' 12. .:)

http://php.net/manual/en/function.date.php

+3
$time = 1293501872;
echo date('D, M n, Y', $time);

echo date("Y.m.d H:i:s", $_SERVER['REQUEST_TIME']);

, . echo time() not date().

+1

date () requires at least one parameter. see document http://php.net/manual/en/function.date.php . you have an output error disabled in php.ini. check your log - in fact it gives an error

0
source

Source: https://habr.com/ru/post/1782381/


All Articles