SQL Server Time to Epoch

SQL Server Time to Epoch

 

  

Hi all,



Can anyone help with a short SQL statement that lets me convert the System
time (presumably using getdate() ) to epoch time?



I have seen a post regarding the opposite (epoch to SQL date format) but I
am unsure how to switch thing around?



This will be run by a postgres DB (the SQL will hopefully be passed from a
*nix command line to the DB (if I can figure that one out) so it may be
possible to get the date from the *nix box and include that in the SQL
statement but I would prefer to perform the operation in one go with a
single SQL statement if possible!



All help greatly appreciated



Regards

Tom




MS Sql Server LazyDBA home page