Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6122019
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:51:01+00:00 2026-05-23T15:51:01+00:00

I have a following code in my php file: <div id=clockTimestamp class=hidden><?=$_SERVER[‘REQUEST_TIME’];?></div> <div id=clock></div>

  • 0

I have a following code in my php file:

<div id="clockTimestamp" class="hidden"><?=$_SERVER['REQUEST_TIME'];?></div>  
<div id="clock"></div>

I am using the jquery countdown plugin from Keith Wood and am calling it like this:

$('#countdown').countdown({until: until, serverSync: getServerTime});

And following code in the js file:

function getServerTime() { 
    var time = $('#clockTimestamp').html()*1000;
    time = new Date(time); 
    return time;
}

Now, my question is: is this approach with the $_SERVER[‘REQUEST_TIME’] OK or should I do it like this:

function getServerTime() { 
    var time = null; 
    $.ajax(
    {
        url: '../../_ajax/getServerTime.php', 
        async: false, 
        dataType: 'text', 
        success: function(text) { 
            time = new Date(text);
        }, 
        error: function(http, message, exc) { 
            time = new Date(); 
        }
    }); 
    return time;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T15:51:02+00:00Added an answer on May 23, 2026 at 3:51 pm

    I’m sure you’ve solved this now, but for later visitors….

    The easiest way to do this would be to use a jQuery server time plugin

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have following PHP code $val=<div id=user.$row['cid']. userid=.$row['cid']. class=innertxt><img src=images/images.jpg width=50 height=50><strong>.$uname.</strong><ul> <li>Email: .$row['cemail'].</li>
I have a menu using the following code, <ol id=feature_list> <li><a href=index.php?action=profile class=feature_current>Profile</a></li> <li><a
I have the following code: if (include_once(dirname(__FILE__).'/file.php') || include_once(dirname(__FILE__).'/local/file.php') ) { This causes an
In PHP I have the following code that gets a file submitted through CGI:
I'm using php and I have the following code to convert an absolute path
I have the following code in a PHP script: <?php if (!in_array(@$_SERVER['REMOTE_ADDR'], array('127.0.0.1', '::1')))
I have the following code in my file to load a div with HTML
I have a file test.php with the following code: <html> <head> <title>Listing 10.2 </title>
I have the following jQuery code in my PHP file (edited Jan 19 2010
I have the following code $content .= ' <div id=myDivID>'; include 'search.php'; $content .=

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.