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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T09:09:54+00:00 2026-06-04T09:09:54+00:00

I tried to change the date format of this countdown jQuery script from local

  • 0

I tried to change the date format of this countdown jQuery script from local time to UTC, but it doesn’t work after my change. I even asked there but didn’t get an answer.

<script>
    $(function(){
        var note = $('#note'),
        ts = new Date.UTC(2012, 0, 1),

        $('#countdown').countdown({
            timestamp: ts,
            callback: function(days, hours, minutes, seconds) {
                var message = "";
                message += days + " day" + ", ";
                message += hours + " hour"  + ", ";
                message += minutes + " minutes"  + " & ";
                message += seconds + " seconds" + " <br />";
                message += "time left";         
                note.html(message);
            }
        });
    });
</script>

I have changed this :

ts = new Date(2012, 0, 1),

into

ts = new Date.UTC(2012, 0, 1),
  • 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-04T09:09:56+00:00Added an answer on June 4, 2026 at 9:09 am

    You have some errors in this script:

    1) ...e.UTC(2012, 0, 1), should end with ;

    2) Date.UTC is not a constructor. Try: new Date(Date.UTC(2012, 0, 1));

    further reading: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date/UTC

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

Sidebar

Related Questions

I tried this JavaScript but it doesn't work - here I need to change
I'm using date picker. I'm trying to change the format of date but I
I've tried to change filenames using following script: find dir/ -type f -exec mv
I've tried achieving a hover/selected color change for a particular field, but I'm thinking
I have tried the usual suspects to try and get this to work. zoom:1,
i have a date/time field called MyDate. Originally, its format is mm/dd/yyyy and there
How can I change the date format of a DateTimePicker in vb.net so that
I got the following date format that I get from an API (Yes I
I tried to change the data folder path of MySQL by changing the datadir
How to upgrade read only sqlite database I have tried to change to SQLiteDatabase.OPEN_READWRITE);

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.