就是用這個Format Data/Time String
至於時間String的格式,可以自己去制定,以下是help裡面的說明。
The following codes are some of the most commonly used time format codes:
%c displays locale-specific date/time time-related format codes include %X (locale-specific time).
%H (hour, 24-hour clock), %I (hour, 12-hour clock), %M (minute), %S (second).
%<digit>u (fractional seconds with <digit> precision)
%p (a.m./p.m. flag); date-related format codes include %x (locale-specific date)
%y (year within century)
%Y (year including century)
%m (month number)
%b (abbreviated month name),
%d (day of month)
%a (abbreviated weekday name).
所以我們想存什麼樣的形式,基本上都有。
舉個例,我希望存檔格式為:年_月_日_星期_時_分_秒
字串只要改成這樣即可
應該算蠻簡單的,以後存檔的每筆資料都可以用這樣子記錄時間下來。
Patrick
沒有留言:
張貼留言