SELFCAD Posted May 20, 2017 Posted May 20, 2017 Hello everybody, I want to convert time format and i don't know how. This function i use to obtain time when a file was modified: (defun time (Fil x / FilObj FilSys RetVal) (setq FilSys (vlax-create-object "Scripting.FileSystemObject") RetVal (cond ((= (vlax-invoke FilSys 'FileExists Fil) 0) nil) ((setq FilObj (vlax-invoke FilSys 'GetFile Fil)) (list (cond ((= (strcase x T) "datecreated") (vlax-get FilObj 'DateCreated)) ((= (strcase x T) "datelastmodified") (vlax-get FilObj 'DateLastModified)) ((= (strcase x T) "datelastaccessed") (vlax-get FilObj 'DateLastAccessed)) ((= (strcase x T) "name") (vlax-get FilObj 'Name)) ((= (strcase x T) "type") (vlax-get FilObj 'Type)) ) ) ) (T nil) ) ) (if FilObj (vlax-release-object FilObj)) (vlax-release-object FilSys) RetVal );end defun I obtain a value like 42812.651. How to convert this value to 2017-May-20 15:50:20 ? with diesel ...but how? Thanks! Quote
Lee Mac Posted May 20, 2017 Posted May 20, 2017 Try the following: (defun foo ( x p ) (menucmd (strcat "m=$(edtime," (rtos (+ 2415019 x) 2 15) "," p ")")) ) For example: _$ (foo 42812.651 "yyyy-mo-dd hh:mm:ss") "2017-03-18 15:37:26" Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.