Change the default time according to clients' timezone

QuestionsChange the default time according to clients' timezone
Kelvin asked 11 years ago

Dear Sir/Madam,

I purchased the license and would like to know how I can set the default date time according to the client's home time?

My server timezone is GMT+5 but clients' timezone is GMT+8, I take reference to below code from FAQs, what is the use of "size"=>20? How can I change the time by adjusting the time difference or get the time according to clients' timezone if I don't know what the clients' timezone is?

// This will set current date as default value.
$col["editoptions"] = array("size"=>20, "defaultValue"=> date("Y-m-d H:i:s") );

I look forward to hearing from your reply.

Best regards,

Kelvin

1 Answers
Abu Ghufran answered 11 years ago

You can set default timezone for your script using date_default_timezone_set()
http://pk1.php.net/date_default_timezone_set

Rest, how to know client's timezone, there are plenty of solution on web. You can try which suits best.

https://www.google.com/search?q=php+get+client+timezone

Your Answer

1 + 5 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?