PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
lawrence_chtan
Forum Newbie
Posts: 22 Joined: Mon Jan 02, 2006 8:20 pm
Location: SINGAPORE
Post
by lawrence_chtan » Fri Jan 19, 2007 1:32 am
Greeting Guru on PHP
I notice when i put in the function
Code: Select all
<?php
// assume now is 2007 01 19 Friday 15:20:38
$currentdatetime=date('d-m-Y D H:i:s')
echo $currentdatetime;
?>
It will display
19-01-2006 Fri 07:20:38
seems like is the locale issue.
how do i fix that? thanks in advance
Luke
The Ninja Space Mod
Posts: 6424 Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA
Post
by Luke » Fri Jan 19, 2007 1:43 am
date_default_timezone_set() possibly?
if not, just figure out the difference between the server time and your time and adjust accordingly.
lawrence_chtan
Forum Newbie
Posts: 22 Joined: Mon Jan 02, 2006 8:20 pm
Location: SINGAPORE
Post
by lawrence_chtan » Fri Jan 19, 2007 2:37 am
Hi
thanks for your great help. It works
Code: Select all
<?php
date_default_timezone_set('Asia/Singapore') ;
$data=date('h:i:s');
echo $data;
?>
GMT+8 show....