Python 时间戳转换
import time
print time.time()
1255334367.7758279
Mon Oct 12 15:59:27 2009
1255332871
2009-10-12 07:34:31
1255334367.7758279
Mon Oct 12 15:59:27 2009
1255332871
2009-10-12 07:34:31
C/C++中的计时函数是clock(),而与其相关的数据类型是clock_t。在MSDN中,查得对clock函数定义如下:
clock_t clock( void );
这个函数返回从“开启这个程序进程”到“程序中调用clock()函数”时之间的CPU时钟计时单元(clock tick)数,在MSDN中称之为挂钟时间(wal-clock)。其中clock_t是用来保存时间的数据类型,在time.h文件中,我们可以找到对它的定义:
The last stop on our widget tour is the most unique. Tkinter also comes with a handful of tools that have to do with the event-driven programming model, not graphics displayed on a computer screen.
Some GUI applications need to perform background activities. periodically. For example, to “blink” a widget’s appearance, we’d like to register a callback handler to be invoked at regular time intervals. Similarly, it’s not a good idea to let a long-running file operation block other activity in a GUI; if the event loop could be forced to update periodically, the GUI could remain responsive. Tkinter comes with tools for both scheduling such delayed actions and forcing screen updates: 继续阅读 »
#!/bin/bash
# User Defined Variables
# H,M,S 系統時間
# rhflag 0 = 當日, 1 = 明天, 2 = 後天…
# strUsage 參數提示訊息
# timeoffset 使用者輸入的時間 (時:分:秒)
# oh,om,os 從 timeoffset 提列出來的 時, 分, 秒 (case 1) / 進位值 (case 2)
# rh,rm,rs 運算結果 時, 分, 秒
# offset 使用 -h, -m, -s 參數時, 使用者帶入的數值 继续阅读 »