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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:26:09+00:00 2026-05-25T12:26:09+00:00

I’m using date.js. The line time_container.innerHTML = Date.now().toString(‘T’); worked fine, briefly, and is now

  • 0

I’m using date.js.

The line time_container.innerHTML = Date.now().toString('T'); worked fine, briefly, and is now throwing errors in the Firebug console: radix must be an integer at least 2 and no greater than 36. It was certainly working earlier.

Note: The date.js toString() function uses special format specifiers.

var show_date = {
    setup: function() {
        setInterval(show_date.update, 5000);
    },
    update: function() {
        var date_container = app.get('js_date');
        var time_container = app.get('js_time');

        if (date_container) {
            date_container.innerHTML = Date.today().toString('dS of MMMM yyyy');
        }
        if (time_container) {
            //time_container.innerHTML = Date.now().toString('T');
            var d1 = new Date();
            time_container.innerHTML = d1.toString('T');
        }
    }
}
app.onload(show_date.setup);

app.get() is just a shortcut for document.getElementById(). app.onload() is (as you might guess) an onload function.

Commented out line is causing the problems. Replacement lines below the comment work, but don’t give the format I want. T should output h:mm:ss tt (hours, minutes, seconds, am/pm). The am/pm bit is missing.

Also, I’m certain Date.now() was working earlier today. Perhaps I’ll try playing with the computer clock to see whether that makes a difference.

Version of date.js included is date-en-IE.js. Claimed date in the code is 2008-05-13, even though I got it from the SVN checkout earlier today.

  • 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-25T12:26:09+00:00Added an answer on May 25, 2026 at 12:26 pm

    ECMAScript 5 already has a Date.now() function that returns the number of milliseconds since January 1, 1970. You’re apparently calling that version so the toString('T') call is on a number, not a Date object. Number.prototype.toString can only take a number from 2 to 36 as its argument, which is where the error is coming from.

    After looking into it a little, it looks like the latest Datejs version doesn’t add its own Date.now() function anymore. Maybe you were using an older version when it worked?

    Try new Date().toString('T') instead, which should work either way.

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

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a jquery bug and I've been looking for hours now, I can't
I am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this

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.