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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T06:25:36+00:00 2026-06-14T06:25:36+00:00

I have a time string populated in select/list control e.g 05:40 I want to

  • 0

I have a time string populated in select/list control e.g 05:40 I want to add 20 minutes in it and populate in textbox everytime when list value get changes in jquery or javascript

$(document).ready(function() {

$("#starttimeList").change(function() {
var selectVal = $('#starttimeList').val();
    ////// HERE I WANT MY CODE AS selectVal is getting value of select control e.g. 05:40 and entTime is my textbox where I want the time added with 20 minutes.
$("#endTime").val(selectVal);

 });
});
  • 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-14T06:25:38+00:00Added an answer on June 14, 2026 at 6:25 am

    If time is in the format hh:mm, you can use a simple function to convert it to minutes, add more minutes, then convert it back to hh:mm again:

    function addMinutes(time/*"hh:mm"*/, minsToAdd/*"N"*/) {
      function z(n){
        return (n<10? '0':'') + n;
      }
      var bits = time.split(':');
      var mins = bits[0]*60 + (+bits[1]) + (+minsToAdd);
    
      return z(mins%(24*60)/60 | 0) + ':' + z(mins%60);  
    }  
    
    addMinutes('05:40', '20');  // '06:00'
    addMinutes('23:50', 20);    // '00:10'
    addMinutes('00:00', '120'); // '02:00'
    

    The minutes to add can be a number or string.

    If you need to allow for daylight saving, using a date object may make life easier.

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

Sidebar

Related Questions

I have a String that represents a time value and is stored in the
I want to change the app.setting connection string at the run time. I have
I have the following code to populate an array of strings, but every time
How do I check for time for between. suppose I have Time in string
I have a service that give me a date time string in the following
I have the following code: int sec = 62; string str = string.Format(Time: {0:xxx},
I have a string variable containing time in hh:mm:ss format . How to convert
I have some java.sql.Time objects as follows: String s1 = 12:00:04; String s2 =
I have a RichTextBox that I write a string to every time I click
I have a comma delimited CSV file being loaded into a String value generated

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.