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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:19:23+00:00 2026-05-26T18:19:23+00:00

As SQL Server returns timestamp like ‘Nov 14 2011 03:12:12:947PM’ , is there some

  • 0

As SQL Server returns timestamp like 'Nov 14 2011 03:12:12:947PM', is there some easy way to convert string to date format like ‘Y-m-d H:i:s’.

So far I use

date('Y-m-d H:i:s',strtotime('Nov 14 2011 03:12:12:947PM'))
  • 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-05-26T18:19:24+00:00Added an answer on May 26, 2026 at 6:19 pm

    SQL Server’s TIMESTAMP datatype has nothing to do with a date and time!

    It’s just a hexadecimal representation of a consecutive 8 byte integer – it’s only good for making sure a row hasn’t change since it’s been read.

    You can read off the hexadecimal integer or if you want a BIGINT. As an example:

    SELECT CAST (0x0000000017E30D64 AS BIGINT)
    

    The result is

    400756068
    

    In newer versions of SQL Server, it’s being called RowVersion – since that’s really what it is. See the MSDN docs on ROWVERSION:

    Is a data type that exposes automatically generated, unique binary numbers within a database. rowversion is generally used as a mechanism
    for version-stamping table rows. The
    rowversion data type is just an incrementing number and does not
    preserve a date or a time
    . To record a date or time, use a datetime2
    data type.

    So you cannot convert a SQL Server TIMESTAMP to a date/time – it’s just not a date/time.

    But if you’re saying timestamp but really you mean a DATETIME column – then you can use any of those valid date formats described in the CAST and CONVERT topic in the MSDN help. Those are defined and supported “out of the box” by SQL Server. Anything else is not supported, e.g. you have to do a lot of manual casting and concatenating (not recommended).

    The format you’re looking for looks a bit like the ODBC canonical (style = 121):

    DECLARE @today DATETIME = SYSDATETIME()
    
    SELECT CONVERT(VARCHAR(50), @today, 121)
    

    gives:

    2011-11-14 10:29:00.470
    

    SQL Server 2012 will finally have a FORMAT function to do custom formatting……

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

Sidebar

Related Questions

So I have a sql server 2005 query that returns results like so: Address
is there a function in SQL Server, which returns difference between UTC time and
I understand that SQL Server endpoint returns data using SOAP. Does anyone know if
Question: The new SQL Server 2008 database returns me values formatted English (date/float). Is
Is it possible to create a SQL Server function which returns a nullable string?
Let's say I have a stored procedure in Microsoft SQL Server 2005 that returns
I have a Microsoft SQL Server 2008 query that returns data from three tables
Is the following possible in SQL Server 2000? CREATE FUNCTION getItemType (@code varchar(18)) RETURNS
Is there a tool out there that can analyse SQL Server databases for potential
My method which calls SQL Server returns a DataReader but because of what I

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.