Hi,
Source is SQL Server, target is Teradata.
Source column is Unix timestamp. 1065531990.
Please let me know how to convert date and time separately.
Searched the forum but could not get exact syntax.
Thank you,
Convert Unix timestamp
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 1735
- Joined: Thu Mar 01, 2007 5:44 am
- Location: Troy, MI
and the syntax will be something like
1065531990 gives the result
2003-10-07 13:06:30 (7th oct 2003 13:06:30)
while the link posted by Craig calculates it to
10 / 07 / 03 @ 8:06:30am (7th oct 2003 8:06:30)
since its just a offset from 1st jan 1970 probably that site is converting it to -5 hrs.
Code: Select all
TimestampFromSecondsSince(<unix timestamp column>, StringToTimestamp("1970-01-01 00:00:00","%yyyy-%mm-%dd %hh:%nn:%ss"))
2003-10-07 13:06:30 (7th oct 2003 13:06:30)
while the link posted by Craig calculates it to
10 / 07 / 03 @ 8:06:30am (7th oct 2003 8:06:30)
since its just a offset from 1st jan 1970 probably that site is converting it to -5 hrs.
Priyadarshi Kunal
Genius may have its limitations, but stupidity is not thus handicapped.
Genius may have its limitations, but stupidity is not thus handicapped.