sybase unix time

Hi All,

would appreciate if you can please help me with this.

Is there a way I can get UNIX_TIMESTAMP in sybase 11.9.2 version?
Who is Participating?
alpmoonConnect With a Mentor Commented:

getdate() function normally returns UNIX date and time. Have you tried it:

select getdate()

You can also use "convert(char, getdate(), <dateformat>)" to convert it to a desired format. dateformat of 112 put year first, 8 gives only time etc.
gandolphxxConnect With a Mentor Commented:
datediff(ss,"19700101",<date col>) -> UNIX timestamp!! will get you a SUN based timestamp returned - note that it is GMT, you will need to adjust +/1 offset*3600 to match your timezone.

FWIW: dateadd(day, 1, SUBSTRING(CONVERT(varchar,getdate()),1,11)) is a handy way to get to midnight.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.