pLz HelP mE pLZzzz

Started on the old forum in May 2012 · view the original in the archive · old links redirect here

5 replies · 466 views · started 14 years ago · 1 min read

2 participants
Ghost Senior · 366 posts #2

heres how i use php to get "my" current time to show instead of the servers time.

/* timezone
Add how many hours and minutes you need
(change the FIRST + symbol after time() ONLY!)
(do not touch the second symbol)
("+" = forward "-" = backwards)
NOTE: ONLY CHANGE THE + SYMBOL IF YOU NEED TO GO BEHIND SERVER TIME */
$hours = "1";
$mins = "";
$timezone = time() + ($hours)*60*60 + ($mins)*60;
$time=date("H:i",$timezone);

then to show the "new" time set. you simple just

echo "$time";

hope this helps solve your problem.

<?php include ('Ghost'); if ($Post == true) { echo ' ![](http://destrukt.dk/ico/phpdeveloper.jpg) alt='coding-talk.com!!' />'; echo 'Sharing Is Caring!'; } else { echo ' ![](http://img98.imageshack.us/img98/6476/av3ro4.jpg) alt='the username GHOST has been comprimised!' />'; echo 'OMG SOMEBODY HELP ME!!'; } ?>
dreamer143 Newbie · 3 posts #3

dude thanxx for that bt i tried it...

if u dont mind can u tell me how to chng my servr tym...

Ghost Senior · 366 posts #4

dreamer143 wrote: DuDe thanxx For that bt i tried it...

if u dont mind can u tell me how to chng my servr tym...

i dont believe you can change your servers time. you can only change what it displays through php.

the code above i showed you will easily change the servers time..

for example.

if server time is lets say. 15:00 (3pm) and your time is 18:00 (6pm)

you would just change the 1 to a 3 where it says.

$hours = "1";

echo the $time and youll see the time has changed from 15:00 to 18:00

if you wanted to "behind server time" you changed 2 things.

lets say your server time is still 15:00 but your time iss 12:00

you'd change these 2 lines.

change again 1 to 3,

$hours = "1";

but this time you also changed.

$timezone = time() + ($hours)*60*60 + ($mins)*60;

to this, change the "first" + symnol, to a - symbol. like so.

$timezone = time() - ($hours)*60*60 + ($mins)*60;

thats basically how to manipulate the time appearance.

<?php include ('Ghost'); if ($Post == true) { echo ' ![](http://destrukt.dk/ico/phpdeveloper.jpg) alt='coding-talk.com!!' />'; echo 'Sharing Is Caring!'; } else { echo ' ![](http://img98.imageshack.us/img98/6476/av3ro4.jpg) alt='the username GHOST has been comprimised!' />'; echo 'OMG SOMEBODY HELP ME!!'; } ?>
dreamer143 Newbie · 3 posts #5

thanxx thanxx sorry for that i m trubling u bt i m new in this coding world and i dont knw much abt it..

Ghost Senior · 366 posts #6

dreamer143 wrote: thanxx thanxx sORry for that i m trubling u bt i m nEw iN thIs coding woRld and i dOnt knW much abt iT..

well goodluck. hope what ive showed you you can put to good use 🙂

goodluck,

<?php include ('Ghost'); if ($Post == true) { echo ' ![](http://destrukt.dk/ico/phpdeveloper.jpg) alt='coding-talk.com!!' />'; echo 'Sharing Is Caring!'; } else { echo ' ![](http://img98.imageshack.us/img98/6476/av3ro4.jpg) alt='the username GHOST has been comprimised!' />'; echo 'OMG SOMEBODY HELP ME!!'; } ?>

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close