/    Sign up×
Community /Pin to ProfileBookmark

Hello everyone
Im a beginner
I would like to ask: Do you now any names of function to find time of user?

For example: website is in germany. American wrote a comment. He must see time from his timezone. Not from germany
I looked for it in php manual but havn’t found anything. Maybe its connected with ip??

Thank you for your suggestions?

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@NogDogMar 02.2012 — The function you would likely use is date_default_timezone_set(). However, that's the simple part. The more complex part is how you intend to "know" the user's timezone. Will it be something the user selects when registering an account, or do you want to try to guess it based on the apparent IP address of the user, or what?
Copy linkTweet thisAlerts:
@johny1000authorMar 02.2012 — My new idea is that i will read a timezone from computer of user in javascript. But im wondering what if the js is disabled??
Copy linkTweet thisAlerts:
@hyperionXSMar 02.2012 — If the use has javascript enabled you calculate the difference using php and javascript

If not, you ask him to tell you his timezone ?
Copy linkTweet thisAlerts:
@johny1000authorMar 02.2012 — Thanks for replies i will go this way
×

Success!

Help @johny1000 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...