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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T02:14:13+00:00 2026-05-17T02:14:13+00:00

I need to create a table with just 1 column containing times (starting from

  • 0

I need to create a table with just 1 column containing times (starting from 4hrs) which increase in increments of 10 seconds for each row. So it needs to look something like this:

04hrs 00mins 00secs – 04hrs 00mins 09secs

04hrs 00mins 10secs – 04hrs 00mins 19secs

04hrs 00mins 20secs – 04hrs 00mins 29secs

…..

06hrs 59mins 50secs – 06hrs 59mins 59secs

This will obviously take a long long time to hard code so I’m looking to create it dynamically. Based on what i’m currently trying to learn I’d like to be able to do this using jquery or asp.net (vb) but anything will do as long as it works!

Thanks

  • 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-17T02:14:14+00:00Added an answer on May 17, 2026 at 2:14 am

    Basic date-time arithmetic.

    // format the given date in desired format
    // ignores date portion; adds leading zeros to hour, minute and second
    function fd(d){
     var h = d.getHours();
     var m = d.getMinutes();
     var s = d.getSeconds();
     return (h < 10 ? '0'+h : h) + 'hrs ' +
        (m < 10 ? '0'+m : m) + 'mins '+
        (s < 10 ? '0'+s : s) + 'secs';
    }
    // 1) 10800 seconds = 3600 * 3 = 3 hours
    // 2) a+=10 increments seconds counter in 10-second interval
    for ( var a = 0; a < 10800; a+=10 ) {
      // an arbitrary date is chosen, we're more interested in time portion
      var b = new Date('01/01/2000 04:00:00');
      var c = new Date();
      b.setTime(b.getTime() + a*1000);
      // c is b + 9 seconds
      c.setTime(b.getTime() + 9*1000);
      $("#table1").append(
        "<tr><td>" + fd(b) + ' - ' + fd(c) + "</td></tr>"
      );
    }
    

    See the output here. I think you can port this code example to ASP.Net/VB.Net/C# easily.

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

Sidebar

Related Questions

I need to create a historical timeline starting from 1600's to the present day.
I need to create a database table to store different changelog/auditing (when something was
I would need to create a temp table for paging purposes. I would be
I need to create an SQL query to insert some data into a table
I need to create an ASP page (classic, not ASP.NET) which runs remote shell
I need to create an XML schema that looks something like this: <xs:element name=wrapperElement>
I need to create a linked server to a DB2 database on a mainframe.
I need to create a backup of a SQL Server 2005 Database that's only
I need to create a 2D int array of size 800x800. But doing so
I need to create a quick-n-dirty knob control in Visual Basic 2005 Express, the

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.