Dynadot .com transfer sale, only $10.12 with coupon code DYNA12, available while supplies last, ends October 1, 2026.

PHP Time zone help

Namecheap AuctionsNamecheap Auctions
Namecheap AuctionsNamecheap Auctions
Spacemail by SpaceshipSpacemail by Spaceship
Watch

Exhale

Established Member
Impact
0
So i am running xZero classifieds, and i am trying to set it up so that the time is for Mountain Standard. I want to know if this is possible by editing anything here? Basically, its the time function that everything else goes to, i do believe

Code:
function QuickDate($timestamp, $showtime=TRUE, $gmt=FALSE, $format="")
{
	if(!$format)
	{
		if($showtime) $format = $GLOBALS['langx']['datetimeformat'];
		else $format =  $GLOBALS['langx']['dateformat'];
	}

	return xDate($timestamp, $gmt, $format, $GLOBALS['langx']['months'], $GLOBALS['langx']['weekdays']);
}

Thanks in advance
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
can you put in the function for xDate as well?
 
0
•••
You can use date_default_timezone_set() to set the default timezone used by all date/time functions in a script (PHP >= 5.1.0).

eg:
date_default_timezone_set("America/Phoenix");
 
0
•••
Not sure which one it would be, but here is a few of the ones i found

Code:
	if ($_GET['date']) $xdate = $_GET['date'];
	else $xdate = date("Y-m-d");


Code:
	preg_match("/([0-9]+)-([0-9]+)-([0-9]+)/", $xdate, $dp);
	$xdatestamp = mktime(0, 0, 0, $dp[2], $dp[3], $dp[1]);
	$xdate_y = $dp[1];
	$xdate_m = $dp[2];
	$xdate_d = $dp[3];

either of those?
 
0
•••
? anybody?
 
0
•••
neither of those two, it'll be something like:

PHP:
function xDate($arg1 ... etc) {
//function
}


also, did you try date_default_timezone_set("timezone"); like sutuicom suggested?
 
0
•••
Where would i put that?
 
0
•••
just stick it in the file all the way at the top where you got the code from your FIRST post from. see if it does anything.
 
0
•••
It isn't about PHP for setting a fixed timezone. [There might be one but I prefer other way round]

You can set the timezone from .htaccess file ;)

Code:
SetEnv TZ America/New York
 
0
•••
i tried the htaccess one but had no luck, And i tried adding the php one and it worked mint!

Thank you all!
 
0
•••
DomainEasy: white label portfolios are live. Enable yours.

We're social

Escrow.com
Spaceship
Escrowly
CryptoExchange.com
Domain Recover
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back