Solved

sybase unix time

Posted on 2004-04-27
4
1,030 Views
Last Modified: 2012-05-04
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?
0
Comment
Question by:irodov
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 13

Accepted Solution

by:
alpmoon earned 25 total points
ID: 10934189
Hi,

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.
0
 

Assisted Solution

by:gandolphxx
gandolphxx earned 25 total points
ID: 10984611
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.
0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here's how to start interacting with our community through Post.
Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question