明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
12
返回列表 发新帖
楼主: xianaihua

获得文件日期,时间的函数

  [复制链接]
发表于 2009-11-30 08:42:00 | 显示全部楼层

(defun c:systime(/ n y r s f m yy rr ff mm cfile timetable)
(setq timetable (vl-file-systime "d:\\1.log"))
(setq n (itoa (nth 0 timetable)))
(setq y (nth 1 timetable)) (if (< y 10) (setq yy (strcat "0" (itoa (nth 1 timetable)))) (setq yy (itoa (nth 1 timetable))))
(setq r (nth 3 timetable)) (if (< r 10) (setq rr (strcat "0" (itoa (nth 3 timetable)))) (setq rr (itoa (nth 3 timetable))))
(setq s (itoa (nth 4 timetable)))
(setq f (nth 5 timetable)) (if (< f 10) (setq ff (strcat "0" (itoa (nth 5 timetable)))) (setq ff (itoa (nth 5 timetable))))
(setq m (nth 6 timetable)) (if (< m 10) (setq mm (strcat "0" (itoa (nth 6 timetable)))) (setq mm (itoa (nth 6 timetable))))
(setq cfile (strcat n yy rr s ff mm))


)

发表于 2012-7-18 14:16:43 | 显示全部楼层
请问楼主:能否获得并设置当前打开的dwg文件的日期
发表于 2012-7-18 20:52:23 | 显示全部楼层
本帖最后由 chlh_jd 于 2012-7-18 20:54 编辑
  1. (defun get-file-date(f)
  2.   (if (setq f (findfile f))
  3.     (setq f (vl-file-systime f)
  4.    f (mapcar (function (lambda (x) (rtos x 2 0))) f)
  5.    f (strcat (car f)"-"(cadr f)"-"(cadddr f)" "(car(cddddr f))":"(cadr(cddddr f))":"(caddr(cddddr f))))))
确实 vl-file-systime

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2025-7-22 00:11 , Processed in 0.159428 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表