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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T13:04:52+00:00 2026-06-04T13:04:52+00:00

I have a unix time eg: var later= 135000; When I take the variable

  • 0

I have a unix time eg: var later= 135000;

When I take the variable later -= 1000 I am able to get 134000.

But when I take the variable later += 1000 I get 1350001000.

How can I increase my unix time?

<script type="text/javascript"> 
   var later = "<?php echo $unix_time; ?>";
   var stop= setInterval('countdown()',1000);

   function countdown(plus_ten) {
        var now = new Date();

        var now_time= now.getTime()/1000;
        now_time= Math.floor(now_time);

        if(plus_ten){
            later = later + 1000;
            alert(later);
        }

        var sec = later- now_time;
        if(sec<=0){
            clearInterval(stop);
            alert('hello');
        }

        sec= Math.floor(sec);
        var min = Math.floor(sec / 60);
        var hour = Math.floor(min / 60);

        hour %= 24;
        min %= 60;
        sec %= 60;

        document.getElementById("hoursBox").innerHTML = hour;
        document.getElementById("minsBox").innerHTML = min;
        document.getElementById("secsBox").innerHTML = sec;       
    }
</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-06-04T13:04:53+00:00Added an answer on June 4, 2026 at 1:04 pm

    Your variable ‘later’ is assigned a string value when you do:

    var later = "<?php echo $unix_time; ?>";
    

    You should instead do:

    var later = <?php echo $unix_time; ?>; // i.e. no quotes around the time stamp
    

    That should fix it.

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

Sidebar

Related Questions

How can I get UNIX time in decimals in C, like Python does that?
I have a table with statistics and a field named time with Unix Timestamps.
I have a table containing view/click records. The time is stored in a unix
I have a Unix timestamp that I need to get the individual year, month,
Assuming I have a unix timestamp in PHP. How can I round my php
I have unix timestamps from time zone X which is not known, the current
I have a record of data with unix time date in it i want
I have unix timestamps in my database. Now I want to get only results,
I am trying to get the GMT in unix time. I use the following
I have written a function to convert a date into a Unix time stamp.

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.