DIESEL for LISPers

DIESEL for LISPers

VG-Wort Access-ZählmarkeHere are some useful routines to receive nicely formatted dates and times in AutoLISP. Each function takes a system variable name as its argument. Valid arguments are the variables containing Julian dates: "DATE", "TDUPDATE", and "TDCREATE". formattime is a utility function used by all the examples:

(defun formattime (format sysvar)
(menucmd (strcat "m=$(edtime,$(getvar," sysvar ")," format ")"))
)

Here are four typical routines to format date and time. Fell free to add others.

(defun 24hour (sysvar)
(formattime "HH:MM" sysvar)
)
(defun civilclock (sysvar)
(formattime "H:MMam/pm" sysvar)
)
(defun internationaldate (sysvar)
(formattime "DD.MO.YY" sysvar)
)
(defun longdate (sysvar)
(formattime "MONTH D\",\" YYYY" sysvar)
)

This is a shareware document. What is a shareware document? Did this article help you earn some money? Then give something back! Help creating shareware documents by donating something to the author:

猜你喜欢

转载自blog.csdn.net/pilifeng1/article/details/82344314