[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

sybase unix time

Posted on 2004-04-27
4
Medium Priority
?
1,054 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
2 Comments
 
LVL 13

Accepted Solution

by:
alpmoon earned 100 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 100 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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

Sometimes MS breaks things just for fun... In Access 2003, only the maximum allowable SQL string length could cause problems as you built a recordset. Now, when using string data in a WHERE clause, the 'identifier' maximum is 128 characters. So, …
Most folks would know the basics of how Dropbox works, so that’s not the purpose of this article. Security is what it’s all about, so here I’ll share how I choose to secure my Dropbox Account and the Data it contains.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

829 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