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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T01:36:41+00:00 2026-06-04T01:36:41+00:00

How can I convert SQL time using a datetime stamp to milliseconds. I am

  • 0

How can I convert SQL time using a datetime stamp to milliseconds.
I am doing a highstock chart using VB.Net

and this is my selection code so far

    Dim mydatalist As New List(Of XyData)
    Dim sqlReader As SqlDataReader
    Dim strConn As New     SqlConnection(ConfigurationManager.ConnectionStrings("myCipConnection").ConnectionString)
    Dim strSql As String = "SELECT TOP 1000 DATEDIFF(second,{d '1970-01-  01'},dtmStamp)AS dtmStamp  ,dblReturnTemp  FROM tblCIPEventData  "
    Dim sqlCmd As New SqlCommand(strSql, strConn)
    strConn.Open()
    sqlReader = sqlCmd.ExecuteReader

I have a SQL selection

Dim strSql As String = "SELECT TOP 1 dtmStamp ,dblReturnTemp   FROM tblCIPEventData"

The result looks like

2009-10-22 11:29:31.513

How can I convert this to milliseconds

  • 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-04T01:36:43+00:00Added an answer on June 4, 2026 at 1:36 am

    To figure out the milliseconds of a date you first have to compare it to some other DateTime. By subtracting two DateTime objects you will end up with a TimeSpan object. Then that TimeSpan object can be converted to milliseconds. This can all be done with one simple line of code:

    Dim milliseconds As Double
    milliseconds = (end - start).TotalMilliseconds
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I convert this string date to datetime in oracle. 2011-07-28T23:54:14Z Using this
I have following time stamp in Integer form 1333125342 I can convert it using
I'm using Microsoft SQL Server 2000 and need to convert my time column to
I have this chunk of SQL from a stored procedure and i can convert
How can I convert the time part of a given DATETIME to the number
How can I convert a database from MySQL to MS SQL Server 2005?
Can any body help me to convert the following SQL query in LinqToSql syntax.
You can convert a negative number to positive like this: int myInt = System.Math.Abs(-5);
How i can convert to c# code files to html files?Is there any generation
So I know I can convert a string to a hashcode simply by doing

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.