SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: user side time

  1. #1
    SitePoint Addict
    Join Date
    Oct 2010
    Posts
    207
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    user side time

    i need user side time which become actally in his country or on his computer.. actually which function i use & how thanks when he post any forum on my site etc

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,729
    Mentioned
    104 Post(s)
    Tagged
    4 Thread(s)
    The date object is what you would use. His client will provide his client-side time/date. You can place that info in a hidden field of the form that he submits.

    Notice that there's no guarantee that you will obtain a correct time and date. You might have 1980 for the year, or 2038, depending on how the client's computer is set up.

    You may just want to get their time zone offset, so that you can apply that to the server time and date.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  3. #3
    SitePoint Addict
    Join Date
    Oct 2010
    Posts
    207
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well date object did not give us user local time that give server side time on which time that script run on server that time

  4. #4
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,729
    Mentioned
    104 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by realcoder View Post
    well date object did not give us user local time that give server side time on which time that script run on server that time
    Are you saying that this did not give you what is written in the documentation?

    getHours
    Returns the hour (0-23) in the specified date according to local time.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


Bookmarks

Posting Permissions

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