AutoLisp函數集_01 —讀取系統日期與時間 (getting system date and time)

(cdate) : 系統日期
(ctime) : 系統時間
(defun cdate(/ cd) ; 系統日期
    (setq cd (rtos (getvar "cdate") 2 0))
    (princ (strcat (substr cd 1 4) "/" (substr cd 5 2) "/" (substr cd 7 2) ))
)
(defun ctime(/ cd) ; 系統時間
    (setq cd (rtos (getvar "cdate") 2 8))
    (princ (strcat (substr cd 10 2) ":" (substr cd 12 2) ))
)


發表留言