PHP code is using UTC not Local
-
I am using some code I found to try to have a special of the day:
‘<?php $today = date(‘N’);
if( $today == 1) { ?>
<div class=”monday”>monday</div>
<?php } elseif( $today == 2 ) { ?>
<div class=”tueday”>tuesday</div>
<?php } elseif( $today == 3 ) { ?>
<div class=”wednesday”>wednesday</div>
<?php } elseif( $today == 4 ) { ?>
<div class=”thursday”>thursday</div>
<?php } elseif( $today == 5 ) { ?>
<div class=”friday”>friday</div>
<?php } elseif( $today == 6 ) { ?>
<div class=”saturday”>saturday</div>
<?php } elseif( $today == 7 ) { ?>
<div class=”sunday”>sunday</div>
<?php } ?>’Problem is at 4PM Pacific time, it turns to midnight UTC and it changes to the next day.
I have some code:
‘<?php echo date(‘H:i’, current_time(‘timestamp’));?>’
I am using to display the time right above it and it is working fine.
I REALLY need some help here, have tried almost everything and I need to get this working to launch the site.
- The topic ‘PHP code is using UTC not Local’ is closed to new replies.