Current location: Hot Scripts Forums » Programming Languages » PHP » Set to Indonesian Time (GMT+7)


Set to Indonesian Time (GMT+7)

Reply
  #1 (permalink)  
Old 02-05-04, 11:19 PM
ivan's Avatar
ivan ivan is offline
Newbie Coder
 
Join Date: Jul 2003
Location: malang-indonesia
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Set to Indonesian Time (GMT+7)

My Server in USA,
I write
<? $date=date("d F Y h:i"); ?>
but display USA time's.
How to set date or time to Indonesian Time (GMT+7) ?
Reply With Quote
  #2 (permalink)  
Old 02-06-04, 04:37 AM
NeverMind's Avatar
NeverMind NeverMind is offline
Community VIP
 
Join Date: Aug 2003
Location: K.S.A
Posts: 2,257
Thanks: 0
Thanked 2 Times in 1 Post
you can use this old way:
PHP Code:

$time time() + (3600*7);

$date date("d F Y h:i"$time); 
but here comes a problem which is the time between US and the time you want isn't 7 hours !!
I know there is a gmt time function, but I am not fimilar with it..
so you could just find the time between USA and your country and replace number seven in $time with it ..

or wait for another person to help you in gmttime
__________________
PHPSimplicity
We don't need a reason to help people - Zidane [FF9]

Last edited by NeverMind; 02-06-04 at 04:42 AM.
Reply With Quote
  #3 (permalink)  
Old 02-09-04, 10:10 PM
ivan's Avatar
ivan ivan is offline
Newbie Coder
 
Join Date: Jul 2003
Location: malang-indonesia
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by NeverMind
you can use this old way:
PHP Code:

$time time() + (3600*7);

$date date("d F Y h:i"$time); 
but here comes a problem which is the time between US and the time you want isn't 7 hours !!
I know there is a gmt time function, but I am not fimilar with it..
so you could just find the time between USA and your country and replace number seven in $time with it ..

or wait for another person to help you in gmttime
ok thanks,
different time USA and Indonesia = 15 hours.
but i want display day, date month year in indonesian type.

example script:
<?
$usa = time();
$id = $usa + 15 *3600;
print "USA Time : " .date("l d/M/Y h:i:s A",$usa)."<br>";
print "Indonesian Time : " .date("l d/M/Y h:i:s A",$id)."<br>";
?>
OUTPUT :
USA Time : Monday 09/February/2004 07:47:55 PM
Indonesian Time : Tuesday 10/February/2004 10:47:55 AM

(should be Indonesian Time : Selasa 10/Februari/2004 10:47:55 AM)

day(english=>indonesian)
===================
Sunday=>Minggu
Monday=>Senin
Tuesday=>Selasa
Wednesday=>Rabu
Thursday=>Kamis
Friday=>Jumat
Saturday=>Sabtu

month(english=>indonesian)
======================
January=>Januari
February=>Februari
March=>Maret
April=>April
May=>Mei
June=>Juni
July=>Juli
August=>Agustus
September=>September
October=>Oktober
November=>Nopember
December =>Desember

help me..
__________________
irfani_f@yahoo.com
irfani.ptmunibraw.org
Reply With Quote
  #4 (permalink)  
Old 02-09-04, 10:40 PM
gforce gforce is offline
Newbie Coder
 
Join Date: Nov 2003
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by ivan
ok thanks,
different time USA and Indonesia = 15 hours.
but i want display day, date month year in indonesian type.

example script:
<?
$usa = time();
$id = $usa + 15 *3600;
print "USA Time : " .date("l d/M/Y h:i:s A",$usa)."<br>";
print "Indonesian Time : " .date("l d/M/Y h:i:s A",$id)."<br>";
?>
OUTPUT :
USA Time : Monday 09/February/2004 07:47:55 PM
Indonesian Time : Tuesday 10/February/2004 10:47:55 AM

(should be Indonesian Time : Selasa 10/Februari/2004 10:47:55 AM)

day(english=>indonesian)
===================
Sunday=>Minggu
Monday=>Senin
Tuesday=>Selasa
Wednesday=>Rabu
Thursday=>Kamis
Friday=>Jumat
Saturday=>Sabtu

month(english=>indonesian)
======================
January=>Januari
February=>Februari
March=>Maret
April=>April
May=>Mei
June=>Juni
July=>Juli
August=>Agustus
September=>September
October=>Oktober
November=>Nopember
December =>Desember

help me..

PHP has built in locale functionality using the setlocale() function.
I'm not entierly familiar with it's use, but your problem interested me so I looked it up in the on-line manual. There are settings for Indonesia. There are some helpful user notes posted in the English on-line version of the manual. Hope this helps.

gforce
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
time Alii Script Requests 2 03-20-04 11:31 AM
wait time alirezaok ASP 3 01-07-04 09:12 PM
Reduce the time intensive phases of .Net application development using TierDeveloper3 smars General Advertisements 0 12-02-03 05:15 AM
Showing time is users time zone? Nasimov PHP 1 11-20-03 07:14 AM
save connection time moorefieldman Perl 1 10-23-03 11:37 PM


All times are GMT -5. The time now is 08:42 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.