- 论坛徽章:
- 0
|
sybase 时间和系统不同步
问题解决,多谢hobbylu提醒。
原来启动sybase的script里的时区设置不一样,时间变了的是和系统时区一样。时间没变的时区设的是GMT。
另外,俺在网上找到一段很精辟的关于sybase时间,系统时间和夏时制关系的论述。给大家转过来看看:
IMHO, ideally ASE is set up so it is not going to be affected by daylight savings
time - I think it is best to run ASE on GMT / Universal standard time and let clients
(which could be in multiple time zones) handle the conversion to the local time zone
plus any adjustments due to daylight savings time. On UNIX systems, this is
accomplished by either running the enire box on GMT, or by setting the TZ (time zone)
enironment variable for the "sybase" user (the user who boots the ASE).
If ASE is run so that the OS does adjust for daylight savings time under it,
a) The datetime datatype does not include a timezone component, so if 2AM happens
twice in one day, you won't be able to tell if a record was from the first 2am or
the second 2am unless you add some additional indicator to the table.
b) The getdate() function works by making a call to the OS every time it is called,
so it will immediately reflect the change in time
c) ASE also maintains an internal clock which it updates as it receives ticks from
the OS. ASE makes a call to the OS to get the current time once a minute and
checks for a difference between the internal and OS clock and then can slow down
or speed up the internal clock somewhat in an attempt to resynch them - but the
internal clock never will run in reverse, at best it will increment very very
slowly. This internal clock is used to generate the "crdate" values in sysobjects,
and populates the datetime stamp on begintran and endtran log records - which
could effect the "load tran with until_time" command. |
|