I'm currently having the strangest issue. I have the following php code which should render the current day and date but it's giving 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 doesn't return anything.
I'm running PHP Version 5.2.13 via fastcgi on lighttpd (managed by Kloxo). My timezone is correctly set on the server (CentOS 5.5).
I don't know if this is a server problem or a php.ini problem so I'm posting here. Please move if necessary.
'D, M n, Y' means "textual representation of day, short textual representation of month, numeric representation of month, year". So, yes, December is the twelfth month, hence 'n' will be 12. All throughout December. :)
http://php.net/manual/en/function.date.php
$time = 1293501872;
echo date('D, M n, Y', $time);
echo date("Y.m.d H:i:s", $_SERVER['REQUEST_TIME']);
Check what date it returns. echo time() not date().
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With