CJSmith dot me

I dump stuff I find useful here

T-SQL Get current Unix Time

On

09/12/2016

By

Chris Smith

In

SQL Server

The following allows you to work out the current time on the Unix Environment. The Datediff function is used to work out the number of seconds between 01/01/1970 and the current date.
I have used this against data which is stored and as Unix time.

--Get current Unix datetime
SELECT DATEDIFF(s, '1970-01-01 00:00:00', GETUTCDATE()) as UnixTime
Select dateadd(S, , '1970-01-01')

Other resources for T-SQL Dates:
DwainCSQL

Categories

  • Access 2010
  • Batch File Scripting
  • Business Objects
  • Cindercone Magma
  • Cisco Unity Communications
  • Datalinx WHM
  • FolderMill
  • Georgia Universal Terminal Server
  • IBM Domino 8.0
  • IBM Notes 8.0
  • Lotus Domino 6.0
  • Microsoft Office
  • Old Stuff
  • Outlook 2010
  • Sage Line 500 ERP
  • SQL Server
  • SQL Server 2008
  • SQL Server 2008 Express
  • SQL Server 2012
  • Syncplify.me Server!
  • SyncToy 2.1
  • Uncategorized
  • V1 DBForms
  • V1 Document Management
  • Visual Basic for Applications
  • Windows
  • Windows 10
  • Windows 7
  • Windows Server 2008
  • Windows Server 2012
  • Windows Server 2016
  • Word Press

Archives

  • June 2022
  • April 2022
  • August 2021
  • February 2021
  • January 2021
  • November 2020
  • October 2020
  • August 2020
  • June 2020
  • May 2020
  • February 2020
  • December 2019
  • September 2019
  • August 2019
  • July 2019
  • June 2019
  • May 2019
  • April 2019
  • February 2019
  • January 2019
  • December 2018
  • October 2018
  • September 2018
  • June 2018
  • May 2018
  • April 2018
  • March 2018
  • February 2018
  • January 2018
  • December 2017
  • November 2017
  • October 2017
  • August 2017
  • July 2017
  • May 2017
  • March 2017
  • February 2017
  • January 2017
  • December 2016
  • November 2016
  • October 2016

CJSmith dot me


This site utilises the Charta block theme.


© 2022 CJSmith dot me