Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Convert int to datetime

197 views
Skip to first unread message

Kjell Pettersen

unread,
Aug 25, 2004, 6:55:27 AM8/25/04
to
Hi!

Is it possible to convert an int field to datetime?

In one of our Sybase ASE DB there is a field called "time" of type int, and
it contains the
value 1093409123. In the application it looks like this is converted to
25.08.2004 06:45

Or is it so that Sybase cannot do this kind of conversation, so it is the
application who is doing this.

Kjell P.

Manoj Kumar

unread,
Aug 25, 2004, 7:19:07 AM8/25/04
to
Sybase can not directly convert int value to date datatype. Some
applicatinon like remedy use int values to represent datetime. There must be
some base datetime value in which u should add these int values to get
datetime.
like in ur case if u do
select dateadd(ss,-1093409123,'08/25/2004 06:45')

it gives 'Jan 1 1970 1:59AM' which seems to be base datetime value for u.


regards
Manoj


"Kjell Pettersen" <kj...@gpsgroup.cc> wrote in message
news:412c701f$1@forums-1-dub...

Michael Peppler

unread,
Aug 25, 2004, 8:26:08 AM8/25/04
to
On Wed, 25 Aug 2004 03:55:27 -0700, Kjell Pettersen wrote:

> Hi!
>
> Is it possible to convert an int field to datetime?
>
> In one of our Sybase ASE DB there is a field called "time" of type int, and
> it contains the
> value 1093409123. In the application it looks like this is converted to
> 25.08.2004 06:45

See my answer in news://comp.database.sybase

Michael
--
Michael Peppler Data Migrations, Inc.
mpep...@peppler.org http://www.peppler.org/
Sybase T-SQL/OpenClient/OpenServer/C/Perl developer available for short or
long term contract positions - http://www.peppler.org/resume.html

Stefan Karlsson

unread,
Aug 26, 2004, 1:42:46 PM8/26/04
to
"Michael Peppler" <mpep...@bluewin.ch> wrote in message
news:pan.2004.08.25....@bluewin.ch...

> On Wed, 25 Aug 2004 03:55:27 -0700, Kjell Pettersen wrote:
>
> > Hi!
> >
> > Is it possible to convert an int field to datetime?
> >
> > In one of our Sybase ASE DB there is a field called "time" of type int,
and
> > it contains the
> > value 1093409123. In the application it looks like this is converted to
> > 25.08.2004 06:45
>
> See my answer in news://comp.database.sybase

It's news://comp.databases.sybase

Google has it at: http://tinyurl.com/5kq23

HTH,

/Stefan


Michael Peppler

unread,
Aug 27, 2004, 9:29:58 AM8/27/04
to
On Thu, 26 Aug 2004 10:42:46 -0700, Stefan Karlsson wrote:

> "Michael Peppler" <mpep...@bluewin.ch> wrote in message
> news:pan.2004.08.25....@bluewin.ch...
>> On Wed, 25 Aug 2004 03:55:27 -0700, Kjell Pettersen wrote:
>>
>> > Hi!
>> >
>> > Is it possible to convert an int field to datetime?
>> >
>> > In one of our Sybase ASE DB there is a field called "time" of type int,
> and
>> > it contains the
>> > value 1093409123. In the application it looks like this is converted to
>> > 25.08.2004 06:45
>>
>> See my answer in news://comp.database.sybase
>
> It's news://comp.databases.sybase

Thanks - I should type slower... :-)

0 new messages