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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T05:59:05+00:00 2026-06-09T05:59:05+00:00

I want to convert datetime format for my radtime picker. I am getting 2012-8-2-13-00-00

  • 0

I want to convert datetime format for my radtime picker. I am getting 2012-8-2-13-00-00
as my output when I pick date from my radtime picker. When I try to convert in to date it is saying invalid date.

The JavaScript:

function SourqtyValidation()
{
var specifiedtime = document.getElementById('<%=txtSpecifiedArrvialTime.ClientID %>').value;
                alert(specifiedtime);
                var a = new Date(specifiedtime);
var actuvalarrivaltime = document.getElementById('<%=txtActualArrivalTime.ClientID %>').value;
alert(actuvalarrivaltime);
                var b = new Date(actuvalarrivaltime);
                b.format("dd/MM/yyyy hh:mm:ss");
                alert(b);
                var difference =Math.round((a - b) / 1000);
                alert(difference);
}

The aspx:

//txtSpecifiedArrvialTime = predifened as 2012/08/02 09:35:55;

  <telerik:RadTimePicker ID="txtActualArrivalTime" runat="server" EmptyMessage="Actual Arrival Time">                                                        </telerik:RadTimePicker>

So how can I get difference between two times in minutes?

  • 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-09T05:59:06+00:00Added an answer on June 9, 2026 at 5:59 am

    to get the time difference,date should be in same format,
    “2012-8-2-13-00-00” is not the correct format, convert it into format of “2012/08/02 13:00:00”
    than you can get the differencein in second by dividing it to 1000.

    you can use this to convert your string to datetime

     var dt = '2012-8-2-13-00-00'.split(/\-|\s/);
        dat = new Date(dt.slice(0,3).reverse().join('/')+' '+dt[3]+':'+dt[4]+':'+dt[5]);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I received DateTime String from Fedex in following format 2012-06-22T21:39:48-05:00 I want to convert
I want to convert a date in string format into Datetime without spliting it.I
How to convert C# datetime to MySql Datetime format. I am getting value from
I want to convert a C# DateTime to YYYYMMDDHHMMSS format. But I don't find
I wanted to convert DateTime data which will be pulled from source, to Date
I want to convert a string in a specific format to a DateTime .
I have a date coming in this format MM-DD-YYY from view and i want
I want to get records from sql server 2005 in datetime format like this
I want to format the date/time that I got from metadata calling of Dropbox
I want to convert date of birth from a text file.Let's say, I have

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.