The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
hey
in a custom page, when someone add something (maybe a comment system), it adds to database current server time using TIMENOW on my server..time zone is GMT +07.00 so it add to mysql db that +7 time now the problem is...when that time retrives from DB it shows time in that +7 format no matter if the user's timezone is GMT or GMT -5 or anything. it always show time +7 format. example- if an artical is added at 10.00am (GMT)...it will be add in database like 5.00pm (as my server is +7 ) then if a user (who is using GMT-5) browse that comment next day...he sees Added on yesterday at 5.00pm (but he shud see 5.00am as he is using gmt-5) now how can i solve it? ....(i cant change server time) i heard about vbdate function although i dont know anything about it. it might be useful. ps: DST also shud be worked |
#2
|
||||
|
||||
![]()
Dates are stored as Unix timestamps in the database. So, when you get the date/time out of the database, you need to do something to it to make it into a date and time and in the current zone of the person viewing the page. That is where vbdate comes in. You should look the function up in the API to see what it does (under Quick Links).
|
#3
|
|||
|
|||
![]()
ya ya ya. i know that very well. & i tried vbdate(). it can convert UNIX timestamp to normal like php date() function.
but thats not my problem i want to include user's (current user) timezone here with DST setting & the API cannot explain much about it (coz i tried & failed) so kindly giv me some example codes here plz --------------- Added [DATE]1256721711[/DATE] at [TIME]1256721711[/TIME] --------------- nevermind...i solved it --------------- Added [DATE]1256722111[/DATE] at [TIME]1256722111[/TIME] --------------- just another question PHP Code:
is there any way to get that same result with a single line (command) ?? |
#4
|
||||
|
||||
![]()
You must use the two lines like you are using in order to get the time & date.
|
![]() |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|