Unstoppable Domains โ€” Get your daily AI drops report

Date function in PHP not working??

SpaceshipSpaceship
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
•••
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
•••
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
•••
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
•••
Appraise.net
Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Domain Recover
CatchDoms
DomDB
NameFit
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back