One of them any columns of information I need from a MSSQL database contain DATETIME, I'm pulling this off of a server that is not local and importing the results into a local MySQL Server. I have two problems. First of all, the MSSQL Server is in UTC time, and I am in Eastern time, I have included what I use to fix this problem, I need to know now how to convert the Fields from MSSQLs format, to MySQL's:
DateTime in MSSQL:
DateTime in MySQL (what I need the output from MSSQL to look like):
Help would be much appreciated
This is how I convert from UTC to Eastern time:
declare @utcoffset datetime;
set @utcoffset = cast(getutcdate() - getdate() as decimal(12,7));
Then when I select a datetime field I do:
select field - @utcoffset, fiel2, field3 from table.
thus I'm assuming I would need to do select convert(field) - @utcoffset, or select convert(field - @utcoffset).