Jump to content

[SOLVED] working with dates


CincoPistolero

Recommended Posts

I have a page that displays current date. Cool. Problem, It appears that the server is in central europe. So here it is 3pm in California and my page thinks its tomorrow. Below is how I get the date. Is there a way to change this so it subracts like 9 hours from the current server time.

 

createdDate= date("F j, Y");

Link to comment
https://forums.phpfreaks.com/topic/180610-solved-working-with-dates/
Share on other sites

Good place to start.  http://www.php.net/manual/en/function.date-default-timezone-set.php

 

<?php
date_default_timezone_set('America/Los_Angeles');

$script_tz = date_default_timezone_get();

if (strcmp($script_tz, ini_get('date.timezone'))){
    echo 'Script timezone differs from ini-set timezone.';
} else {
    echo 'Script timezone and ini-set timezone match.';
}
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.