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

  • SEARCH
  • Home
  • 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 7610331
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T01:23:34+00:00 2026-05-31T01:23:34+00:00

I have a actual date from php script. When I’ll include it into the

  • 0

I have a actual date from php script. When I’ll include it into the js script it will be not he same as dynamic js ‘new Date()’. I must use the date from php (at this point I can’t use the same from js) to js script but this date must stay dynamic.

How to change static date from $time_local_js into dynamic date similar to js new Date() to use into this countdown script? An pararell clock?

<script type="text/javascript"> 
d_new=+new Date(2012,11,6,21,00,00);  
d_old= new Date(<?php echo $time_local_js ?>);  
(function(){ 
sec=(d_new-d_old)/1000; 

document.getElementById('show').innerHTML=~~(sec/(3600*24))+' days '+~~(sec/3600)%24+' hours '+~~(sec/60)%60+' min '+~~sec%60+' sek'; 

setTimeout(arguments.callee,1000)})() 
</script>
  • 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-31T01:23:35+00:00Added an answer on May 31, 2026 at 1:23 am

    EDIT

    From you last comments, now I believe you don’t need PHP at all for this. Maybe to set d_new, depending on the case. But d_old has to be redefined every time the function is called by the timer. Is this what you need?

    <script type="text/javascript"> 
    var d_new=+new Date(2012,11,6,21,00,00);  
    (function(){ 
        var d_old= new Date();
        sec=(d_new-d_old)/1000; 
        document.getElementById('show').innerHTML=~~(sec/(3600*24))+' days '+~~(sec/3600)%24+' hours '+~~(sec/60)%60+' min '+~~sec%60+' sek'; 
        setTimeout(arguments.callee,1000)
    })();
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

sorry but I do not have the actual code with me, but I will
Is it possible to have 2 report parameters set the same actual parameter? For
I have a script that polls a MySQL database (Nagios, specifically) for the date/time
I need to parse the actual date value from a config file. So I
How do you put two different function outputs from the same controller into the
I am using JDateChooser from here However I can not retrieve the date in
I have a php script that returns just plain text without any html. Now
I have a query select user_id,sum(hours),date, task_id from table where used_id = 'x' and
I'm new to PHP and I have this homework to do. The teacher asked
I have the following code: The actual problem is the non-quoted code. I want

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.