Convert date/time value to human readable format

Last post 02-01-2017, 10:43 AM by BondUniverse. 4 replies.
Sort Posts: Previous Next
  • Convert date/time value to human readable format
    Posted: 08-09-2016, 11:39 AM

    I'm working on a SQL query to pull some information.  The part that I'm having an issue with is getting the date/time value stored in the SQL DB to a human readable format.

     

    Sample value:  1470719665

    Any idea how I can convert this via a SQL Query?

  • Re: Convert date/time value to human readable format
    Posted: 08-09-2016, 11:49 AM

    i think you are looking for something like DATEADD function. or add the number of seconds from the 01/01/1970 to get the date value in readable format ( Number of days in seconds + Jan 01 1970) will give the current date

  • Re: Convert date/time value to human readable format
    Posted: 08-09-2016, 4:02 PM

    Could you give me a sample SQL Query?  Not sure how to quite use the dateadd via that method with the data in the format I'm getting it in.

    Thanks for the help!

  • Re: Convert date/time value to human readable format
    Posted: 08-10-2016, 6:22 AM

    selectDATEADD(second,1470719665,'1970-1-1')

     

    Result:

    2016-08-09 05:14:25.000

  • Re: Convert date/time value to human readable format
    Posted: 02-01-2017, 10:43 AM

    The DATEADD definitely converts it to a readable date/time.  However, I'm wondering what time zone the date is stored in, and if not local time, how best to handle the time zone difference.

    (I'm the original poster, just with a new company and had to create a new account)

The content of the forums, threads and posts reflects the thoughts and opinions of each author, and does not represent the thoughts, opinions, plans or strategies of Commvault Systems, Inc. ("Commvault") and Commvault undertakes no obligation to update, correct or modify any statements made in this forum. Any and all third party links, statements, comments, or feedback posted to, or otherwise provided by this forum, thread or post are not affiliated with, nor endorsed by, Commvault.
Commvault, Commvault and logo, the “CV” logo, Commvault Systems, Solving Forward, SIM, Singular Information Management, Simpana, Commvault Galaxy, Unified Data Management, QiNetix, Quick Recovery, QR, CommNet, GridStor, Vault Tracker, InnerVault, QuickSnap, QSnap, Recovery Director, CommServe, CommCell, SnapProtect, ROMS, and CommValue, are trademarks or registered trademarks of Commvault Systems, Inc. All other third party brands, products, service names, trademarks, or registered service marks are the property of and used to identify the products or services of their respective owners. All specifications are subject to change without notice.
Close
Copyright © 2019 Commvault | All Rights Reserved. | Legal | Privacy Policy