Results 1 to 2 of 2

Thread: Show Text Per User's Time via PHP?

  1. #1
    Join Date
    Jun 2007

    Show Text Per User's Time via PHP?

    I would like to display certain text per the user's time. For instance, in the morning the text would say "Good Morning", after noon would say "Good Afternoon", after six would output "Good Evening" and so on.

    How can I do this easily via PHP?

  2. #2
    Join Date
    Aug 2004
    You can only do it if you somehow get information from the user indicating what his/her local time zone is. This could be part of the user registration process if, in fact, users must register. Otherwise you would have to either use some JavaScript to get the local time info and let your script know somehow (AJAX?) or use some sort of IP-to-location database to make a best guess as to the user's location and time zone.
    "Well done....Consciousness to sarcasm in five seconds!" ~ Terry Pratchett, Night Watch

    How to Ask Questions the Smart Way (not affiliated with this site, but well worth reading)

    My Blog
    cwrBlog: simple, no-database PHP blogging framework

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center