VL-FILE-SYSTIME returns something like the following:
(2014 5 3 7 11 42 27 275)
(rtos (getvar "date") 2 10) returns something like...
"2456785.587002848"
What would a function look like that would return True if VL-FILE-SYSTIME falls before midnight...?
something like
(apply '< (list (fix (ctoj 2014 5 3 7 11 42))(fix (getvar "date"))))
Note: ctoj function comes from Julian.lsp
Solved! Go to Solution.
Solved by Gary_J_Orr. Go to Solution.
@mdhutchinson wrote:VL-FILE-SYSTIME returns something like the following:
(2014 5 3 7 11 42 27 275)
- Year
- month
- day of the week
- day of the month
- hours
- minutes
- seconds
(rtos (getvar "date") 2 10) returns something like...
"2456785.587002848"
What would a function look like that would return True if VL-FILE-SYSTIME falls before midnight...?
something like
(apply '< (list (fix (ctoj 2014 5 3 7 11 42))(fix (getvar "date"))))
Note: ctoj function comes from Julian.lsp
You need to skip the "day of the week" value for ctoj (it needs looks for the day of the month):
where lst = the return from the vl-file-systime function and hours, minutes, and seconds are replaced with 0's since all you want is the day
(setq lst '(2014 5 3 7 11 42 27 275))
(< (fix (ctoj (car lst) (cadr lst) (cadddr lst) 0 0 0)) (fix (getvar "date")))
-G
of course you could always use nth as well and put in as many values as you want without going through the ca....r contortions:
(<
(fix (ctoj (nth 0 lst) (nth 1 lst) (nth 3 lst) (nth 4 lst) (nth 5 lst) (nth 6 lst)))
(fix (getvar "date"))
)
-G