picnichouse Posted January 21, 2006 Posted January 21, 2006 Hi, Anyone know how to create a Unix timestamp that I can use for importing into my SQL server? (10 digit number, i.e. 2147483647) Thanks!
comment Posted January 21, 2006 Posted January 21, 2006 Yes, but it is not necessarily a 10-digit number, just the number of seconds since Jan 1, 1970. And you're supposed to convert it from your local time to UTC, so: Let ( [ unixEpoch = Timestamp ( Date ( 1 ; 1 ; 1970 ) ; Time (0 ; 0 ; 0 ) ) ; offset = Time ( <> ; 0 ; 0 ) ] ; GetAsNumber ( yourTimestamp - offset - unixEpoch ) ) where yourOffsetFromUTC is the difference, in hours, between your local time and UTC. For example, for EASTERN STANDARD TIME enter -5, for EASTERN DAYLIGHT SAVING TIME enter -4.
Recommended Posts
This topic is 6946 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now