svn服务器时间与本地时间不同步解决
在用svn的时候,由于svn的时间与本地不同步,导致每次看log总是需要对时间。
今天修改了svn服务器时间与本地同步。只需要修改svn服务器时间与本地时间相同即可,但要主要修改时区,不然会出现时间又不同步的问题。
记录之。
/***********************************************************************************************************/
Linux 时钟分为系统时钟(System Clock)和硬件(Real Time Clock ,简称RTC )时钟。系统时钟是指当前Linux Kernel中的时钟,而硬件时钟则是主板上由电池供电的时钟,这个硬件时钟可以在BIOS中进行设置。当Linux 启动时,硬件时钟会去读取系统时钟的设置,然后系统时钟就会独立于硬件运作。
Linux中的所有命令(包括函数)都是采用的系统时钟设置。在Linux中,用于时钟查看和设置的命令主要有date、hwclock和clock。其中,clock和hwclock用法相近,只用一个就行,只不过clock命令除了支持x86硬件体系外,还支持Alpha硬件体系。
1、date
查看系统时间
# date
设置系统时间
# date --set “07/07/06 10:19" (月/日/年时:分:秒)
2、hwclock/clock
查看硬件时间
# hwclock --show
或者# clock --show
设置硬件时间
# hwclock --set --date="07/07/06 10:19" (月/日/年 时:分:秒)
或者# clock --set --date="07/07/06 10:19" (月/日/年 时:分:秒)
3、硬件时间和系统时间的同步
按照前面的说法,重新启动系统,硬件时间会读取系统时间,实现同步,但是在不重新启动的时候,需要用hwclock或clock命令实现同步。
硬件时钟与系统时钟同步:# hwclock --hctosys(hc代表硬件时间,sys代表系统时间)或者# clock --hctosys
系统时钟和硬件时钟同步:# hwclock --systohc或者# clock --systohc
4、时区的设置
# tzselect
Please identify a location so that time zone rules can be set correctly.Please select a continent or ocean
1) Africa
2) Americas
3) Antarctica
4) Arctic Ocean
5) Asia
6) Atlantic Ocean
7) Australia
8) Europe
9) Indian Ocean
10) Pacific Ocean
11) none - I want to specify the time zone using the Posix TZ format.
输入5,亚洲
Please select a country
1) Afghanistan
18) Israel
35) Palestine
2) armenia
19) Japan
36) Philippines
3) Azerbaijan
20) Jordan
37) Qatar
4) Bahrain
21) Kazakhstan
38) Russia
5) Bangladesh
22) Korea (North)
39) Saudi Arabia
6) Bhutan
23) Korea (South)
40) Singapore
7) Brunei
24) Kuwait
41) Sri Lanka
8) Cambodia
25) Kyrgyzstan
42) Syria
9) China
26) Laos
43) Taiwan
10) Cyprus
27) Lebanon
44) Tajikistan
11) East Timor
28) Macau
45) Thailand
12) Georgia
29) Malaysia
46) Turkmenistan
13) Hong Kong
30) Mongolia
47) United Arab Emirates
14) India
31) Myanmar (Burma)
48) Uzbekistan
15) Indonesia
32) Nepal
49) Vietnam
16) Iran
33) Oman
50) Yemen
17) Iraq
34) Pakistan
输入9,中国
Please select one of the following time zone regions
1) east China - Beijing, Guangdong, Shanghai, etc.
2) Heilongjiang
3) central China - Gansu, Guizhou, Sichuan, Yunnan, etc.
4) Tibet & most of Xinjiang Uyghur
5) southwest Xinjiang Uyghur
输入1,北京时间
The following information has been given:
China east China - Beijing, Guangdong, Shanghai, etc
Therefore TZ="Asia/Shanghai" will be used.Local time is now: Fri Jul 7 10:32:18 CST 2006.Universal Time is now: Fri Jul 7 02:32:18 UTC 2006.Is the above information OK?1) Yes2) No
输入1,确认
如果不用tzselect命令,可以修改文件变更时区。
# vi /etc/sysconfig/clock ZONE=Asia/Shanghai(查/usr/share/zoneinfo下面的文件) UTC=false ARC=false
# rm /etc/localtime
# ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
重新启动即可。
svn服务器时间与本地时间不同步解决的更多相关文章
- python获取网络时间和本地时间
今天我们来看一下如何用python获取网络时间和本地时间,直接上代码吧,代码中都有注释. python获取网络时间 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 ...
- Python: 处理mongodb文档,怎么让UTC时间转换为本地时间?
存储数据到MongoDB数据库时,一般我们会加一个更新数据的时间update_time.这时在python代码中 会用到datetime模块以便获取当前系统时间,但是存入到MongoDB数据库时,存储 ...
- ubuntu下的时间设定(硬件时间,系统时间,本地时间)
问题的来由是在这里: 在cron里设定任务是在凌晨6点执行,检查日志时发现时间总是不对,是在22点左右的时间执行的.研究发现,任务是在本地时间的6点执行了,但不知为什么syslog中的时间都是为utc ...
- Python中如何把一个UTC时间转换为本地时间
需求: 将20141126010101格式UTC时间转换为本地时间. 在网上搜了好长时间都没有找到完美的解决方案.有的引用了第三方库,这就需要在现网安装第三方的软件.这个是万万不可的.因为真实环境不一 ...
- UNIX时间与本地时间的转换
所谓UNIX时间,维基百科的解释:UNIX时间,或称POSIX时间是UNIX或类UNIX系统使用的时间表示方式:从协调世界时1970年1月1日0时0分0秒起至现在的总秒数,不包括闰秒 知道了是什么,就 ...
- UTC、GTC时间和本地时间
1.问题 对于装有Windows和Linux系统的机器,进入Windows显示的时间和Linux不一致,Linux中的时间比Windows提前8个小时. 2.解决方法 修改/etc/default/r ...
- [转帖]UTC时间、GMT时间、本地时间、Unix时间戳
UTC时间.GMT时间.本地时间.Unix时间戳 https://www.cnblogs.com/xwdreamer/p/8761825.html 引用: https://blog.csdn.net/ ...
- UTC时间转换为本地时间
UTC时间转换为本地时间DATEADD(hour, DATEDIFF(hour,GETUTCDATE(),GETDATE()), OrderDate) <'2015-02-02' DECLARE ...
- 关于UTC时间和本地时间
收藏了个类Publics 可以实现本地时间和UTC时间的转换 UCT时间=本地时间-8 本地时间比UTC时间快8小时 element-ui的日期选择器上 选择的时间显示的是本地时间 但实 ...
随机推荐
- hdoj1754 I Hate It【线段树区间最大值维护+单点更新】
I Hate It Time Limit: 9000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total S ...
- PG数据库之间的导入导出
本文将介绍如何对PG数据库进行导入.导出,主要利用的是PG自带的pg_dump.pg_dumpall.pg_restore.psql等命令,版本是9.4(不同版本的pg_dump \ pg_resto ...
- pg_dump实例详解(备份postgresql和greenplum数据库)
一.pg_dump的用法:数据库的导入导出是最常用的功能之一,每种数据库都提供有这方面的工具,例如Oracle的exp/imp,Informix的dbexp/dbimp,MySQL的mysqldump ...
- mysql按字段分组并获取每个分组按照某个字段排序的前三条
这是原始数据 想按照brand_id分组 并获取每个分组total_num最高的前3位 SQL语句为: > (select count(*) from data where brand_id = ...
- js两个时间比较
var applyStart = $("#ApplyStart").val().replace(/-/g,'/'); var applyEnd = $("#ApplyEn ...
- hadoop ssh无密码登陆
VM DHCP蛋疼了,这次整个static... scp
- keepalive support-----Programming applications
TCP Keepalive HOWTO Prev Next 4. Programming applications This section deals with programming code ...
- Linux 性能优化之 IO 子系统 系列 图
http://blog.sina.com.cn/s/articlelist_1029388674_11_1.html Linux 性能优化之 IO 子系统(一) 本文介绍了对 Linux IO 子系统 ...
- Apache CXF 3.0: CDI 1.1 Support as Alternative to Spring--reference
With Apache CXF 3.0 just being released a couple of weeks ago, the project makes yet another importa ...
- 获得Radio选中的后面文本框的值
例如: 选中的radio的值在button中显示 代码如下: <!DOCTYPE html> <html lang="en" xmlns="http:/ ...