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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:59:19+00:00 2026-06-11T01:59:19+00:00

I use telerik raddatepicker control to select a date. I get the date value

  • 0

I use telerik raddatepicker control to select a date.

I get the date value from the control, convert it into javascript Date object and then use getTime to get the total milliseconds:

            var FromDate = $find("<%=fromDate.ClientID%>").get_dateInput().get_displayValue();
            var FromDateMill = new Date(FromDate).getTime();

The date I choose is 6/4/2012 (us).
when I print the result of new Date(FromDate) I get the correct date I chose.

In server side, I try to get datetime object using the milliseconds I got from the javascript so I use this code:

DateTime seventies = new DateTime(1970, 1, 1);
DateTime fromDate = seventies.AddMilliseconds(Convert.ToDouble(Reader["FromDateMill"]));

but when I print fromDate I get 6/3/2012 9:00:00 AM (a day before..).
I checked and saw that the conversion toDouble returns the correct number of milliseconds as I got in the javascript.

Does anyone has an idea what am I doing wrong?

Thanks,
Inbal.

  • 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-11T01:59:20+00:00Added an answer on June 11, 2026 at 1:59 am

    The value that you get from the getTime method is not from the local time, but from the universal time. When you add those milliseconds to 1970-1-1, you get the universal time, not the local time.

    Use the ToLocal method to get the DateTime value for the local time:

    DateTime fromDate =
      seventies.AddMilliseconds(Convert.ToDouble(Reader["FromDateMill"])).ToLocal();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use Telerik RadCalendar ASP.NET control. How I can in code reset selected date?
I use a Telerik control as DatePicker nl. RadDatePicker, the problem is that it
I use a Telerik RadGrid control and various 'Eval' expressions to show data in
I have a problem with the get_selectedItems() function. I use RadGrid from Telerik .
I am trying to use the Telerik MVC Menu control (as a button bar),
Hy, In my app I use Telerik extensions for MVC Grid control: Telerik Grid
Is it true that I can't use the Telerik ASP.NET MVC Controls from Codeplex
I use telerik tabstrip in my mvc 3 application. I have a table inside
I'm trying to use Telerik RadControls in a MVVM kind of way but having
I have a telerik-radgrid where I use an editcolumn. For the edit-column I use

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.