Dynadot Aftermarket: discover domain gems worth investing in. Visit our aftermarket.

Date function in PHP not working??

Namecheap AuctionsNamecheap Auctions
NamecheapNamecheap
Namecheap AuctionsNamecheap Auctions
Watch

bdd

Established Member
Impact
1
hiya ppl i have added the date function into my php page and it doesnt seem to be working correctly... i have done it before with no problems but on this page i have just created it started out working and now after deuploading the files it is displaying yesterday as todays date??? why???

i use this

<?
$today = date("l, d F Y");
?>

and then add the echo $today in my code... and like i said it is displaying a date but it is yesterdays???
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
the obvious thing is that the server is most likely on a different time zone as you so for the server that is still the date.

Alternatively check that the time and date on the server itself is correct.
 
0
Close
can you give us an example of the output of the code and then the current time where you are.

i will be able to help then
 
0
Close
One way to fix this is to add/subtract the difference in seconds from the system time:

3600 = 1 hour
86400 = 1 day
<?php
echo date("l, d F Y",time()-3600);
?>
 
0
Close
DomainEasy: white label portfolios are live. Enable yours.

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Filters for activity feeds
Your news feed, Latest activity, and the activity tab on profiles now have filter buttons: All, Posts, Quick replies, and Other. Your...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back