Here 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:
Contact CR/LF GmbH
© 2000-2011 by CR/LF GmbH, Essen/Germany. All rights reserved.
No part of this document may be reproduced or published without written consent by CR/LF GmbH.
Last modification: 01.04.2011