Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

"timesatmp" datatype is it a date representation

5 posts in General Discussion Last posting was on 2009-06-12 17:57:51.0Z
drigby Posted on 2009-06-12 09:34:50.0Z
Sender: 9c8.4a322076.1804289383@sybase.com
From: drigby@syabse.com
Newsgroups: sybase.public.ase.general
Subject: "timesatmp" datatype is it a date representation
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4a32213a.9d1.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 12 Jun 2009 02:34:50 -0700
X-Trace: forums-1-dub 1244799290 10.22.241.41 (12 Jun 2009 02:34:50 -0700)
X-Original-Trace: 12 Jun 2009 02:34:50 -0700, 10.22.241.41
Lines: 4
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:27851
Article PK: 77103

Does this represent a "point in time" (Date), if so how
would I compare it to getDte() to see if it is yonger or
older than the getdate.
E.g.


Rob V [Sybase] Posted on 2009-06-12 10:44:25.0Z
Reply-To: "Rob V [Sybase]" <robv@DO.NOT.SPAM.sypron.nl.REMOVE.THIS.DECOY>
From: "Rob V [Sybase]" <robv@DO.NOT.SPAM.sypron.nl.REMOVE.THIS.DECOY>
Newsgroups: sybase.public.ase.general
References: <4a32213a.9d1.1681692777@sybase.com>
Subject: Re: "timesatmp" datatype is it a date representation
Lines: 41
Organization: Sypron BV / TeamSybase / Sybase Inc
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4a323189@forums-1-dub>
Date: 12 Jun 2009 03:44:25 -0700
X-Trace: forums-1-dub 1244803465 10.22.241.152 (12 Jun 2009 03:44:25 -0700)
X-Original-Trace: 12 Jun 2009 03:44:25 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:27852
Article PK: 77101

No, it does not. The timestamp is really an internal counter which --in
essence-- gets incremented for ever change to a page in the database. The
purpose of the timestamp datatype is provide a unique value for every such
change, and this is one of the things the transaction log mechanism is based
on.
So the timestamp data has *nothing* to do with real-life "time".

Theinternals of the timestamp mechanism of ASE are hardly documented. Should
you be interested, see chapter 13 of my book "Tips, Tricks & Recipes for
Sybase ASE". Among other things this described how it is possible to
establish a loose relation of timestamp values to real-life time (note the
word 'loose' here).

HTH,

Rob V.
-----------------------------------------------------------------
Rob Verschoor

Certified Sybase Professional DBA for ASE 15.0/12.5/12.0/11.5/11.0
and Replication Server 15.0.1/12.5 // TeamSybase

Author of Sybase books (order online at www.sypron.nl/shop):
"Tips, Tricks & Recipes for Sybase ASE" (ASE 15 edition)
"The Complete Sybase ASE Quick Reference Guide"
"The Complete Sybase Replication Server Quick Reference Guide"

mailto:rob@YOUR.SPAM.sypron.nl.NOT.FOR.ME
http://www.sypron.nl
Sypron B.V., Amersfoort, The Netherlands
Chamber of Commerce 27138666
-----------------------------------------------------------------

<drigby@syabse.com> wrote in message
news:4a32213a.9d1.1681692777@sybase.com...
> Does this represent a "point in time" (Date), if so how
> would I compare it to getDte() to see if it is yonger or
> older than the getdate.
> E.g.


drigby Posted on 2009-06-12 10:58:16.0Z
Sender: 9c8.4a322076.1804289383@sybase.com
From: drigby@sybase.com
Newsgroups: sybase.public.ase.general
Subject: Re: "timestamp" datatype is it a date representation
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4a3234c8.c95.1681692777@sybase.com>
References: <4a323189@forums-1-dub>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 12 Jun 2009 03:58:16 -0700
X-Trace: forums-1-dub 1244804296 10.22.241.41 (12 Jun 2009 03:58:16 -0700)
X-Original-Trace: 12 Jun 2009 03:58:16 -0700, 10.22.241.41
Lines: 2
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:27853
Article PK: 77102

Many thanks for the prompt responce, I'll use DATETIME
instead of TIMESTAMP.


Bret Halford [Sybase] Posted on 2009-06-12 16:56:44.0Z
From: "Bret Halford [Sybase]" <bret@sybase.com>
Organization: Sybase, Inc.
User-Agent: Thunderbird 2.0.0.21 (Windows/20090302)
MIME-Version: 1.0
Newsgroups: sybase.public.ase.general
Subject: Re: "timesatmp" datatype is it a date representation
References: <4a32213a.9d1.1681692777@sybase.com> <4a323189@forums-1-dub>
In-Reply-To: <4a323189@forums-1-dub>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4a3288cc$1@forums-1-dub>
Date: 12 Jun 2009 09:56:44 -0700
X-Trace: forums-1-dub 1244825804 10.22.241.152 (12 Jun 2009 09:56:44 -0700)
X-Original-Trace: 12 Jun 2009 09:56:44 -0700, vip152.sybase.com
Lines: 23
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:27858
Article PK: 77112


Rob V [Sybase] wrote:
> No, it does not. The timestamp is really an internal counter which --in
> essence-- gets incremented for ever change to a page in the database. The
> purpose of the timestamp datatype is provide a unique value for every such
> change, and this is one of the things the transaction log mechanism is based
> on.
> So the timestamp data has *nothing* to do with real-life "time".

I wouldn't really say "nothing". The timestamp value itself doesn't
embed the wall clock time, but it is possible to correlate timestamps
with wall clock time, often fairly accurately, if you have access to the
transaction logs. Every begin and commit tran log record contains a
datetime value and presumably will have at least one other log record
with a timestamp value. So if you have a timestamp value known to come
from a particular database and can find log records with timestamps that
are close to that value, and then look for the datetime values from
begin/commit records a little earlier and later in the log, you can
say that the timestamp was issued between those times. On a busy
server, that may be quite accurate, on a largely static server you might
only be able to pin it down to within a few months or so...


-bret


Rob V [Sybase] Posted on 2009-06-12 17:57:51.0Z
Reply-To: "Rob V [Sybase]" <robv@DO.NOT.SPAM.sypron.nl.REMOVE.THIS.DECOY>
From: "Rob V [Sybase]" <robv@DO.NOT.SPAM.sypron.nl.REMOVE.THIS.DECOY>
Newsgroups: sybase.public.ase.general
References: <4a32213a.9d1.1681692777@sybase.com> <4a323189@forums-1-dub> <4a3288cc$1@forums-1-dub>
Subject: Re: "timesatmp" datatype is it a date representation
Lines: 33
Organization: Sypron BV / TeamSybase / Sybase Inc
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4a32971f$1@forums-1-dub>
Date: 12 Jun 2009 10:57:51 -0700
X-Trace: forums-1-dub 1244829471 10.22.241.152 (12 Jun 2009 10:57:51 -0700)
X-Original-Trace: 12 Jun 2009 10:57:51 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:27859
Article PK: 77110


"Bret Halford [Sybase]" <bret@sybase.com> wrote in message
news:4a3288cc$1@forums-1-dub...
> Rob V [Sybase] wrote:
>> No, it does not. The timestamp is really an internal counter which --in
>> essence-- gets incremented for ever change to a page in the database. The
>> purpose of the timestamp datatype is provide a unique value for every
>> such change, and this is one of the things the transaction log mechanism
>> is based on.
>> So the timestamp data has *nothing* to do with real-life "time".
>
> I wouldn't really say "nothing". The timestamp value itself doesn't
> embed the wall clock time, but it is possible to correlate timestamps
> with wall clock time, often fairly accurately, if you have access to the
> transaction logs. Every begin and commit tran log record contains a
> datetime value and presumably will have at least one other log record
> with a timestamp value. So if you have a timestamp value known to come
> from a particular database and can find log records with timestamps that
> are close to that value, and then look for the datetime values from
> begin/commit records a little earlier and later in the log, you can
> say that the timestamp was issued between those times. On a busy server,
> that may be quite accurate, on a largely static server you might
> only be able to pin it down to within a few months or so...
>
>
> -bret

That's exactly what I meant when, in the second part of my reply, I referred
to the 'loose' relationship that can be established with real-life time.

Rob V.