Solved

sybase unix time

Posted on 2004-04-27
4
1,001 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Cloud-based technologies and services will continue to grow in popularity in 2017 thanks to the simple, scalable and cost-effective solutions they deliver. Here are three areas where cloud adoption is poised to really take off.
An analysis of the phishing scam that has been affecting Google users, along with steps to take for protection, as well as what to do if you receive one of the emails.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

920 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now