|
|
|
|
![]() ![]() |
![]() ![]() Group: Members
Posts: 27 Joined: 5-April 06 Member No.: 21,363 |
Post
#1
Nov 1 2006, 09:02 PM
hey, i know the issue of time and date with php and just been posted. But honestly, i didn't get the answer i neeed. I'm building a user personalization website, and i need help with the time. It all get messed up because the server is in a diiferent time zone. Should i use gmdate() function? because i'm using date(). All that said, whats the best way to use time and dates for like a forum in php? |
![]() Group: [MODERATOR]
Posts: 4,336 Joined: 24-July 05 From: Linix, DOS and Windows…the good, the bad and the ugly Member No.: 9,787 ![]() myCENT:10.0 |
Post
#2
Nov 1 2006, 09:22 PM
Using gmdate() makes the script more portable since all the adjustments are then made against GMT time, so go with that if you plan on making it work on several other servers or if the Server changes time zones. Each user's time adjustment would then be an offset from GMT rather than the Server's Local time. Either way, an adjustment would be required unless they were in the correct zone. |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members
Posts: 181 Joined: 22-February 06 Member No.: 19,007 |
Post
#3
Nov 2 2006, 11:36 AM
as jihaslip has said using gmdate() is always the best opition which then can be adjusted by the user in accordance to his time zone , for which you just have to include a little extra code if you don not have one already
|
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Post
#4
Nov 2 2006, 02:39 PM
Well then what to do if we are to store the GMT time in the database. According to the IST(Indian Standard Time-I live in India) we are 5 and a half hours ahead of GMT. I tried using gmmktime() function and it returns me the time + 5 and a half hours ahead of IST instead of 5 and a half hours behind IST. So just one suggestion use time() store it in the database and then use gmdate to get the GMT time. But this thing has a disadvantage you know. Whenever you change the server to a different one the time settings being different the GMT time and the time itself would be going wrong. |
![]() ![]() Group: Members
Posts: 27 Joined: 5-April 06 Member No.: 21,363 |
|
![]() ![]() Group: Members
Posts: 28 Joined: 6-November 06 Member No.: 32,893 |
Post
#6
Nov 6 2006, 11:08 PM
thanks guys, I also have some issue about the date() function because I want to match my date and time in my area (I'm in GMT+8 area)
|
![]() ![]() |
Similar Topics
| Topic Title | Replies | Topic Starter | Views | Last Action | |||
|---|---|---|---|---|---|---|---|
![]() |
11 | campainer | 1,646 | 14th August 2004 - 03:33 AM Last post by: SilverBoarder |
|||
![]() |
1 | NuHoaXuLa | 516 | 27th August 2004 - 05:43 PM Last post by: odomike |
|||
![]() |
0 | synderoxide | 660 | 8th September 2004 - 04:53 AM Last post by: synderoxide |
|||
![]() |
0 | pasten | 326 | 6th January 2008 - 06:53 AM Last post by: nitish |
|||
![]() |
5 | hulunes | 570 | 20th October 2004 - 02:39 PM Last post by: melkonianarg |
|||
![]() |
133 | Saint_Michael | 10,614 | 1st June 2008 - 12:23 AM Last post by: HyBriD54 |
|||
![]() |
1 | Editor | 236 | 14th October 2004 - 09:11 PM Last post by: wassie |
|||
![]() |
4 | DMA | 365 | 29th October 2004 - 07:50 PM Last post by: odomike |
|||
![]() |
6 | Moneymaker | 290 | 14th November 2004 - 08:59 AM Last post by: googlue |
|||
![]() |
7 | delivi | 288 | 1st July 2006 - 10:09 PM Last post by: delivi |
|||
![]() |
154 | rovertos | 9,453 | 2nd October 2008 - 08:59 PM Last post by: iGuest-Moonfrost |
|||
![]() |
45 | rovertos | 3,267 | 7th May 2005 - 03:59 PM Last post by: MechVegita |
|||
![]() |
7 | cragllo | 933 | 2nd September 2006 - 10:16 AM Last post by: masterio |
|||
![]() |
2 | Vera | 403 | 20th January 2008 - 02:19 PM Last post by: salamangkero |
|||
![]() |
6 | Vigorous | 621 | 18th December 2004 - 04:36 PM Last post by: Vigorous |
|||
|
Lo-Fi Version | Time is now: 5th December 2008 - 07:53 AM |