Morning all,
I'm looking at adding a time stamp, down to the second, when I discovered that the seconds are counting past 60 (typically around to 68 for me). At first I thought the minute hand was just slow to update, but it looks like the minute is updating properly and the seconds are fast. If you watch the video below, you'll see the seconds displayed by DraftSight is constantly ahead of the current time.
Is (GetVar "CDATE") the command I need to be using for time stamps?
Video:
Code:
(progn
(setq fcnDateString
(function (lambda (rDate / sDate)
(setq sDate (rtos rDate 2 6))
(strcat
(substr sDate 1 4) "/" ;-; Year
(substr sDate 5 2) "/" ;-; Month
(substr sDate 7 2) " - " ; Day
(substr sDate 10 2) ":" ;-; Hour
(substr sDate 12 2) ":" ;-; Minute
(substr sDate 14 2);------; Seconds
);strcat
));function<-lambda
);setq
(setq rSeconds 1)
(repeat 120
(setq rDate (getvar "CDATE"));--------------; Current time
(setq sDate (fcnDateString rDate))
(setq rStop (+ rDate (/ rSeconds 864000.0))); Add x seconds to current time
(while (> rStop (getvar "CDATE")) T);-------; Wait x seconds
(prin1 (list sDate (rtos rDate 2 9)))
(terpri)
);repeat
(princ)
)Return:
("2023/03/14 - 09:12:59" "20230314.091259334")
("2023/03/14 - 09:12:61" "20230314.091260510")
("2023/03/14 - 09:12:62" "20230314.091261692")
("2023/03/14 - 09:12:63" "20230314.091262850")
("2023/03/14 - 09:12:64" "20230314.091264050")
("2023/03/14 - 09:12:65" "20230314.091265210")
("2023/03/14 - 09:12:66" "20230314.091266382")
("2023/03/14 - 09:12:68" "20230314.091267582")
("2023/03/14 - 09:12:69" "20230314.091268744")
("2023/03/14 - 09:13:00" "20230314.091300048")
("2023/03/14 - 09:13:01" "20230314.091301260")
("2023/03/14 - 09:13:02" "20230314.091302420")
...
("2023/03/14 - 09:13:57" "20230314.091356550")
("2023/03/14 - 09:13:58" "20230314.091357750")
("2023/03/14 - 09:13:59" "20230314.091358920")
("2023/03/14 - 09:13:60" "20230314.091360107")
("2023/03/14 - 09:13:61" "20230314.091361295")
("2023/03/14 - 09:13:62" "20230314.091362458")
("2023/03/14 - 09:13:64" "20230314.091363642")
("2023/03/14 - 09:13:65" "20230314.091364810")
("2023/03/14 - 09:13:66" "20230314.091365990")
("2023/03/14 - 09:13:67" "20230314.091367170")
("2023/03/14 - 09:13:68" "20230314.091368362")
("2023/03/14 - 09:14:00" "20230314.091400012")
("2023/03/14 - 09:14:01" "20230314.091401170")
("2023/03/14 - 09:14:02" "20230314.091402363")
...
("2023/03/14 - 09:14:57" "20230314.091457453")
("2023/03/14 - 09:14:59" "20230314.091458610")
("2023/03/14 - 09:14:60" "20230314.091459773")
("2023/03/14 - 09:14:61" "20230314.091460932")
("2023/03/14 - 09:14:62" "20230314.091462090")
("2023/03/14 - 09:14:63" "20230314.091463253")
("2023/03/14 - 09:14:64" "20230314.091464423")
("2023/03/14 - 09:14:66" "20230314.091465590")
("2023/03/14 - 09:14:67" "20230314.091466750")
("2023/03/14 - 09:14:68" "20230314.091467910")
("2023/03/14 - 09:15:00" "20230314.091500010")
("2023/03/14 - 09:15:01" "20230314.091501210")
("2023/03/14 - 09:15:02" "20230314.091502428")
("2023/03/14 - 09:15:04" "20230314.091503624")
...
("2023/03/14 - 09:15:58" "20230314.091557596")
("2023/03/14 - 09:15:59" "20230314.091558760")
("2023/03/14 - 09:15:60" "20230314.091559920")
("2023/03/14 - 09:15:61" "20230314.091561080")
("2023/03/14 - 09:15:62" "20230314.091562297")
("2023/03/14 - 09:15:63" "20230314.091563460")
("2023/03/14 - 09:15:65" "20230314.091564678")
("2023/03/14 - 09:15:66" "20230314.091565860")
("2023/03/14 - 09:15:67" "20230314.091567030")
("2023/03/14 - 09:15:68" "20230314.091568210")
("2023/03/14 - 09:16:00" "20230314.091600020")
("2023/03/14 - 09:16:01" "20230314.091601180")
("2023/03/14 - 09:16:02" "20230314.091602340")
...
("2023/03/14 - 09:16:57" "20230314.091657452")
("2023/03/14 - 09:16:59" "20230314.091658630")
("2023/03/14 - 09:16:60" "20230314.091659833")
("2023/03/14 - 09:16:61" "20230314.091660990")
("2023/03/14 - 09:16:62" "20230314.091662150")
("2023/03/14 - 09:16:63" "20230314.091663312")
("2023/03/14 - 09:16:64" "20230314.091664490")
("2023/03/14 - 09:16:66" "20230314.091665648")
("2023/03/14 - 09:16:67" "20230314.091666810")
("2023/03/14 - 09:16:68" "20230314.091667980")
("2023/03/14 - 09:17:00" "20230314.091700000")
("2023/03/14 - 09:17:01" "20230314.091701157")
("2023/03/14 - 09:17:02" "20230314.091702323")
...
("2023/03/14 - 09:19:57" "20230314.091956664")
("2023/03/14 - 09:19:58" "20230314.091957830")
("2023/03/14 - 09:19:59" "20230314.091959030")
("2023/03/14 - 09:19:60" "20230314.091960188")
("2023/03/14 - 09:19:61" "20230314.091961360")
("2023/03/14 - 09:19:63" "20230314.091962570")
("2023/03/14 - 09:19:64" "20230314.091963742")
("2023/03/14 - 09:19:65" "20230314.091964920")
("2023/03/14 - 09:19:66" "20230314.091966107")
("2023/03/14 - 09:19:67" "20230314.091967277")
("2023/03/14 - 09:19:68" "20230314.091968436")
("2023/03/14 - 09:20:00" "20230314.092000000")
("2023/03/14 - 09:20:01" "20230314.092001203")
("2023/03/14 - 09:20:02" "20230314.092002362")
...
("2023/03/14 - 09:20:58" "20230314.092057600")
("2023/03/14 - 09:20:59" "20230314.092058790")
("2023/03/14 - 09:20:60" "20230314.092059950")
("2023/03/14 - 09:20:61" "20230314.092061110")
("2023/03/14 - 09:20:62" "20230314.092062335")
("2023/03/14 - 09:20:63" "20230314.092063490")
("2023/03/14 - 09:20:65" "20230314.092064690")
("2023/03/14 - 09:20:66" "20230314.092065856")
("2023/03/14 - 09:20:67" "20230314.092067030")
("2023/03/14 - 09:20:68" "20230314.092068233")
("2023/03/14 - 09:21:00" "20230314.092100010")
("2023/03/14 - 09:21:01" "20230314.092101210")
("2023/03/14 - 09:21:02" "20230314.092102397")
...
("2023/03/14 - 09:21:57" "20230314.092156537")
("2023/03/14 - 09:21:58" "20230314.092157700")
("2023/03/14 - 09:21:59" "20230314.092158884")
("2023/03/14 - 09:21:60" "20230314.092160057")
("2023/03/14 - 09:21:61" "20230314.092161260")
("2023/03/14 - 09:21:62" "20230314.092162420")
("2023/03/14 - 09:21:64" "20230314.092163610")
("2023/03/14 - 09:21:65" "20230314.092164777")
("2023/03/14 - 09:21:66" "20230314.092165958")
("2023/03/14 - 09:21:67" "20230314.092167117")
("2023/03/14 - 09:21:68" "20230314.092168310")
("2023/03/14 - 09:22:00" "20230314.092200000")
("2023/03/14 - 09:22:01" "20230314.092201160")
("2023/03/14 - 09:22:02" "20230314.092202330")
("2023/03/14 - 09:22:03" "20230314.092203500")
