veket官方网站论坛

veket

 找回密码
 要注册
搜索
楼主: qx0007

考大家一个很简单的veket问题——但你们未必懂的

[复制链接]
发表于 2014-9-18 18:12 | 显示全部楼层
发表于 2014-10-2 02:20 | 显示全部楼层
no 不知道啊 求解!
发表于 2014-10-4 08:30 | 显示全部楼层
回帖看看啦
发表于 2014-11-2 16:43 | 显示全部楼层
不懂就只能回帖了……
发表于 2014-11-4 23:13 | 显示全部楼层
  1.      who -b 查看最后一次系统启动的时间。
  2.       who -r 查看当前系统运行时间
  3. last reboot
  4. uptime

复制代码
  1. cat /proc/uptime
  2. date -d "`cut -f1 -d. /proc/uptime` seconds ago"
  3. date -d "$(awk -F. '{print $1}' /proc/uptime) second ago" +"%Y-%m-%d %H:%M:%S"  
复制代码
  1. Following are the rest of the time function in the above perl code-snippet.

  2. ■$total=((($1*24+$2)*60+$3)*60) – Calculate the total amount of seconds the system is UP. i.e (((days*24+hours)*60+minutes)*60 which gives the seconds (like an epoch calculation)
  3. ■$now=time(); – Get the current time in seconds ( epoch time )
  4. ■$now-=$total; – Subtract total system running time from current time. So this is getting the exact time in second when the system was started
  5. ■$now=localtime($now); – Convert the epoch time ( time in seconds ). localtime returns given epoch time in human readable format
  6. ■print $now,”\n” – Finally, this prints the time.
复制代码
http://www.cnblogs.com/kerrycode/p/3759395.html
http://www.averainy.info/linux-system-operation-time-and-the-view-of-the-latest-powered-up-time/
http://www.thegeekstuff.com/2011/10/linux-reboot-date-and-time
您需要登录后才可以回帖 登录 | 要注册

本版积分规则

QQ|手机版|Archiver|veket官方网站论坛 ( 粤ICP备 11052856 )

GMT+8, 2025-5-2 06:24

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表