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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T19:14:20+00:00 2026-06-13T19:14:20+00:00

i have this datetime format: Oct 31, 2012 08:59:52 i would like to re-calculate

  • 0

i have this datetime format:

Oct 31, 2012 08:59:52

i would like to re-calculate the datetime incremented (for example) of 2 hours or 50 minutes plus how can i do that?

i need to return the same datetime format showed above and not a timestamp!

  • 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-13T19:14:21+00:00Added an answer on June 13, 2026 at 7:14 pm
    var date = new Date("Oct 31, 2012 08:59:52");
    var timeInMillis = date.getTime();
    

    Now that you have time in milliseconds, you can just add the time you want in millis.

    Eg: 2 hours? So, 2*60*60*1000 + timeInMillis

    var newDate = new Date(2*60*60*1000 + timeInMillis);
    

    If you want to convert your newDate into the original format, which is a long process, you can some guidance from here:

    Where can I find documentation on formatting a date in JavaScript?

    My pick of the answers would be:

    Use MomentJS

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

Sidebar

Related Questions

I have this bit on codebehind: txtDBirth.Text = DateTime.Now.ToString(Mon dd yyyy) We would like
I have date in this format 1999-05-31T13:20:00.000-05:00 I want to add some hours or
I updated this question I would like to transform a datetime to the equivalent
I have a WMI query that specifies time in this format '20090219000000.000000+480' Can someone
I have this datetime as string: Thu, 16 Aug 2012 13:17:25 +0200 I want
I have a MySql database that holds datetime in one field, in this format:
I have two textBox in first i have Date in this format : 2012.09.20
I have a String with a datetime format: YYYY-MM-DD HH:MM:SS. I use this in
I have a table logout with columns logout_id logout_datetime values format like this(2011-09-08 11:09:09)
I'd like to convert this string into a datetime object: Wed Oct 20 16:35:44

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.