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 93617
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T23:22:21+00:00 2026-05-10T23:22:21+00:00

I have an app that display’s the current time when a page opens. I

  • 0

I have an app that display’s the current time when a page opens. I would like that time to update every 30 seconds. I’ve read about prototype’s Ajax.PeriodicalUpdater and it seems to be an answer. This is how I achieve the static time display on page load with php:

    <tr>       <td>         <input class='standard' type='text' name='start_time'             value='<?php echo prev_end();?>'>              <!--prev_end is last end time from database-->       </td>         <td>         <input class='standard' type='text' name='end_time'             value='<?php echo $now;?>'>             <!--$now = date('G:i');-->       </td> 

This is what I’ve attempted with prototype:

<script type='javascript'>         new Ajax.PeriodicalUpdater('updater', 'unow.php', {frequency : 30});             </script>         ...        <tr>           <td>             <input class='standard' type='text' name='start_time'                 value='<?php echo prev_end();?>'>           </td>             <td>             <input id='updater' class='standard' type='text' name='end_time'                 value=''>           </td> 

Where ‘unow.php’ does this

<?php   $unow=date('G:i');   echo $unow; ?> 

It seems that I don’t need a callback to put the value from unow.php into the input ‘updater’ since PeriodicalUpdater calls for an element id. What am I missing?

  • 1 1 Answer
  • 1 View
  • 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. 2026-05-10T23:22:22+00:00Added an answer on May 10, 2026 at 11:22 pm

    Unless you want your time output to always match the timezone of the server, you could do this very quickly with a bit of Javascript on the client side and skip contacting the server entirely.

    <html> <body onload='init();'>   <div id=time></div> </body> </html> <script type=text/javascript>  function init() {     updateTime();     window.setInterval(updateTime,30000); }   function updateTime() {     var time = document.getElementById('time');     time.innerText = new Date().toLocaleString(); }  </script> 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 172k
  • Answers 172k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer http://ca.php.net/imap $mb = imap_open("{host:port/imap}","username", "password" ); $messageCount = imap_num_msg($mb); for(… May 12, 2026 at 2:33 pm
  • Editorial Team
    Editorial Team added an answer Have you tried this: From the top menu, select “Settings”… May 12, 2026 at 2:33 pm
  • Editorial Team
    Editorial Team added an answer You should ALWAYS construct your child controls in CreateChildControls. This… May 12, 2026 at 2:33 pm

Related Questions

I have an app that display's the current time when a page opens. I
I've got a list of objects that I need to organize as an aesthetic
I have an app that uploads files to server using the webclient. I'd like
I have an ASP.NET application. It resides within another ASP.NET application. I put my
This a bit of strange one.... We have an internal web app that runs

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.