Solved

sybase unix time

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

This article describes how to reset your Windows 10 password when you've forgotten it.
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

766 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