Search
 
SCRIPT & CODE EXAMPLE
 

SQL

convert epoch to date in sql server

SELECT FROM_UNIXTIME(FLOOR(EPOCH_TIMESTAMP/1000)) FROM table; --if milliseconds
SELECT FROM_UNIXTIME(FLOOR(EPOCH_TIMESTAMP)) FROM table; --no milliseconds
Comment

sql server epoch to datetime

#--------------------------------SQL SERVER----------------------------------
#use this to convert forom bigint unix to datetime
#replace 1500123123 with your number
select  DATEADD(second,1500123123, CAST('1970-01-01 00:00:00' AS datetime))

#it's way better to put this in a function and call the function 
Comment

PREVIOUS NEXT
Code Example
Sql :: postgres advance auto increment 
Sql :: grab part of a string sql 
Sql :: t sql first and last day of week 
Sql :: insert into from 
Sql :: mysql undo delete 
Sql :: php select data from mysql database without column name 
Sql :: mysql regex select 
Sql :: how to save postgresql query 
Sql :: sql round datetime 
Sql :: sql server get week dates from week number 
Sql :: show create table in postgresql 
Sql :: sql delete table 
Sql :: psql query execution time 
Sql :: how to print some string in mysql 
Sql :: postgres backup of table 
Sql :: sum function in sql 
Sql :: mysql curdate between two dates 
Sql :: selecting all columns from table sql database 
Sql :: python list from sql 
Sql :: select * from 
Sql :: triggers db 
Sql :: how to use sqlcommand 
Sql :: aliasing in sql 
Sql :: sql select column names starting with 
Sql :: MySql count occurences more than" 
Sql :: hallo 
Sql :: Column count of mysql.user is wrong. Expected 42, found 44. The table is probably corrupted 
Sql :: sql_inner_join 
Sql :: ms sql bacup table 
Sql :: oracle sqlp update amount / quantity 
ADD CONTENT
Topic
Content
Source link
Name
3+2 =