Incorrect time

My Vanilla Installation s showing different time. where can i Set my time , i have to set Indian Standard time while the Server is at US.
Best Answers
-
peregrine MVP
what version of php are you using?
don't use this - it is nonsense.
date_default_timezone_set('UTC')+05.30; // this is gibberish.
use either
date_default_timezone_set('Asia/Kolkata');
date_default_timezone_set('Asia/Calcutta')
if you want help follow instructions and provide answers to questions.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
5 -
peregrine MVP
@abhilashsnair said:
copied to an Indian Server (IST) still there is a lag of 40 Minutes peregrineperhaps, because you are not focusing and reading the answers on how to add 1/2 hour increment.
Be Aware, if you change the structure of the User Table field HourOffset
you will need to alter table each time you upgrade or run /utiliity/updateor see if you can get the government in India to change the IST timezone to +6:00 UTC or +5UTC
not sure which would happen first vanilla allowing 1/2hour offsets by default or India changing its timezone.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
5 -
peregrine MVP
.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
5
Answers
In your bootstrap.php file, find the
date_default_timezone_set('UTC');
line. You can change UTC to your closest supported timezone. The list of supported timezones can be found here: http://www.php.net/manual/en/timezones.phpSearch first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
i changed
// Make sure a default time zone is set
date_default_timezone_set('UTC')+05.60;
TO
// Make sure a default time zone is set
date_default_timezone_set('Asia/Calcutta')
didnt work again i changed to
// Make sure a default time zone is set
date_default_timezone_set('UTC')+05.30;
again there is a difference in time for 31 Minutes , what may be the error ?
date_default_timezone_set('Asia/Kolkata');
do you know your version of vanilla? if so why don't you follow the posting suggestions to include it in every one of the discussions you create?
and depending on your php version you may need to use
date_default_timezone_set('Asia/Kolkata');
if the below does not work.
date_default_timezone_set('Asia/Calcutta')
as far as
date_default_timezone_set('UTC')+05.30; // this is gibberish.
@abhilashsnair
do you know your version of vanilla? if so why don't you follow the posting suggestions to include it in every one of the discussions you create?
http://vanillaforums.org/discussion/26710/why-adding-your-version-is-more-important-than-ever
http://vanillaforums.org/discussion/26943/tutorial-how-to-determine-the-version-number-of-vanilla-that-you-are-using-for-your-own-forum
I also added these I am sure they will be useful.
http://vanillaforums.org/discussion/18015/how-to-ask-questions-on-the-internet
when-asking-a-question
http://vanillaforums.org/discussion/25115/how-to-how-can-a-new-user-better-help-the-community-
and a few other helpful links:
http://vanillaforums.org/discussion/23130/forum-post-ettikett-etiquette
http://vanillaforums.org/discussion/17954/food-for-thought-forum-etiquette
http://vanillaforums.org/discussion/23483/advice-for-all-those-just-starting-out-with-vanilla
troubleshooting tips: http://vanillaforums.org/discussion/20231/how-to-become-somewhat-adept-at-modifying-vanilla-
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
Vanilla Version 2.1
both these
date_default_timezone_set('Asia/Kolkata');
&
date_default_timezone_set('Asia/Calcutta')
is not working for me
should I guess what not working means or do you want to explain and post example screen shots.
is the time wrong for logged in users or non-logged in users.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
A
Attached screenshot look at the system time and post time. I took screen immediatly after posting
and what is in your hour offset in your user table for user abhilash?
and what is in your bootstrap.php.
is your goal to set it to the time in calcutta?
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
Here is by bootstrap.php
http://pastebin.com/fkkGY38M
.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
what version of php are you using?
use either
date_default_timezone_set('Asia/Kolkata');
date_default_timezone_set('Asia/Calcutta')
if you want help follow instructions and provide answers to questions.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
@abhilashsnair
you apparently say the question is answered. does that mean you solved it.
http://vanillaforums.org/discussion/25115/how-to-how-can-a-new-user-better-help-the-community-
http://vanillaforums.org/addon/versioncheck-plugin
you have a bad habit of not responding to completion with almost every discussion you start
http://vanillaforums.org/profile/discussions/15823/abhilashsnair
not a one says thanks or that it is solved and how you solved it.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
sorry for what i done before Will close all threads . but this case is not solved
try creating a testdate.php and post your results.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
since vanilla has a bug I believe and can't store offsets in 1/2 increments.
for any new discussions posted.
You may need to change the structure on the user table to allow 1/2 hour increments.
I suppose you could set it to
HourOffset decimal(3,1) in the User table
in the user table so it can store all types of timezones.
in js/global.js
you don't need to change bootstrap.php and probably should restore the original found here
https://github.com/vanilla/vanilla/blob/2.1/bootstrap.php
logged in users should now see correct time in Calcutta, with above changes to database and global.js.
report back.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
I alway thought that half hour offsets are funny.
Might as well bring back bristol time GMT-10 minutes.
grep is your friend.
Bristol clock with two minute hands:
Calcutta actually had it own time until 1945, and Bombay/Mumbai till 1955.
grep is your friend.
if it weren't for railroads and commerce - we'd all be on non-standardized times.
http://en.wikipedia.org/wiki/Time_zone
but then again manana is always manana
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
copied to an Indian Server (IST) still there is a lag of 40 Minutes @peregrine
and what changes did you make?
http://vanillaforums.org/discussion/comment/209903/#Comment_209903
what does the user table say for hour offset in the structure.
the idea is to explain what you did step by step (don't say I did it all), if you want help no one can guess what you did!!
do you really want help solving issue, if so, answer all questions, and state exactly what you did.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.