Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

looking for lisp routine that returns the date in format mm/dd/yy and time like 12:00:00

0 views
Skip to first unread message

Mike Cundiff

unread,
Mar 20, 1997, 3:00:00 AM3/20/97
to

Hi all,

I'm looking for lisp routine that returns the date in format mm/dd/yy
and time like 12:00:00.


Mike Cundiff
Utilities, Inc.
www.pivot.net/~cadmike

Christoph Candido

unread,
Mar 20, 1997, 3:00:00 AM3/20/97
to

On Thu, 20 Mar 1997 16:03:26 GMT, cad...@pivot.net (Mike Cundiff)
wrote:

You can easily do this with a DIESEL string:

(defun c:today ()
(menucmd "M=$(edtime,$(getvar, date),MM/DD/YY - HH:MM:SS)")
)

If you would like to use other format phrases, look at "DIESEL-String
Expression Language" in the AutoCAD Customization Manual.

Hope this helps.

--
Chris
*********************************************
Christoph Candido
E-Mail: h854...@edv1.boku.ac.at
University of Agricultural Sciences
Vienna, Austria
*********************************************

Jim Fitzgerald

unread,
Mar 20, 1997, 3:00:00 AM3/20/97
to

cad...@pivot.net (Mike Cundiff) wrote:

>Hi all,
>
>I'm looking for lisp routine that returns the date in format mm/dd/yy
>and time like 12:00:00.
>
>
>Mike Cundiff
>Utilities, Inc.
>www.pivot.net/~cadmike

These just print the values on the command line, the values are not
saved anywhere.

(defun c:today ( / now yy mm dd)
(setq now (rtos (getvar "cdate") 2 6)
yy (substr now 3 2)
mm (substr now 5 2)
dd (substr now 7 2)
)
(princ (strcat "\n" mm "/" dd "/" yy))
(princ)
)

(defun c:ctime ( / now hr min sec)
(setq now (rtos (getvar "cdate") 2 6)
hr (substr now 10 2)
min (substr now 12 2)
sec (substr now 14 2)
)
(princ (strcat "\n" hr ":" min ":" sec))
(princ)
)

-Jim Fitzgerald

Private Ice

unread,
Mar 29, 1997, 3:00:00 AM3/29/97
to

cad...@pivot.net (Mike Cundiff) wrote:

>Hi all,

>I'm looking for lisp routine that returns the date in format mm/dd/yy
>and time like 12:00:00.


>Mike Cundiff
>Utilities, Inc.
>www.pivot.net/~cadmike


You are Utilities, Inc. and YOU want a utility so that I assume you
can sell. I've got an idea, why don't you

1. Learn how to do it yourself.

2. Pay someone to do it, seeing as you are going to sell it.


I'm trying not to get pissed off here, but it's pretty difficult.


Private Ice


Christoph Candido

unread,
Mar 29, 1997, 3:00:00 AM3/29/97
to

I wrote:
>On Thu, 20 Mar 1997 16:03:26 GMT, cad...@pivot.net (Mike Cundiff)

>wrote:
>
>>Hi all,
>>
>>I'm looking for lisp routine that returns the date in format mm/dd/yy
>>and time like 12:00:00.
>>
>>
>>Mike Cundiff
>>Utilities, Inc.
>>www.pivot.net/~cadmike
>
>You can easily do this with a DIESEL string:
>
>(defun c:today ()
> (menucmd "M=$(edtime,$(getvar, date),MM/DD/YY - HH:MM:SS)")
>)

Hi,

The devil won't sleep. There is a bug in my LISP routine, though it's
only one line long. A date like "45/28/97 - 15:45:12" doesn't look
very good. Sorry, there is one M too much (M stands for Month, MM for
Minutes).

Here is the corrected version:

(defun c:today ()
(menucmd "M=$(edtime,$(getvar,date),M/DD/YY - HH:MM:SS)")
)

Sorry again,
and Happy Easter

Chris
--

Rusty Gesner

unread,
Mar 29, 1997, 3:00:00 AM3/29/97
to

Private Ice wrote:

>
> cad...@pivot.net (Mike Cundiff) wrote:
> >I'm looking for lisp routine that returns the date in format mm/dd/yy
> >and time like 12:00:00.
> I've got an idea, why don't you
>
> 1. Learn how to do it yourself.
>
> 2. Pay someone to do it, seeing as you are going to sell it.

Or,

3. Look up edtime in the DIESEL section of the Customization
Guide.

--
B. Rustin (Rusty) Gesner -- Group A --
AutoCAD.Expert.Consultant.Author.Editor (reply to ru...@group-a.com)
Co-author of Maximizing AutoCAD R13 (now available) &
Maximizing AutoLISP for AutoCAD R13 & R14 (available after R14 -- late
Summer) See http://www.group-a.com/~rusty for info or to BUY A BOOK

Spammers: e-mails not DIRECTLY concerning the primary topics of this
newsgroup will be considered unsolicited, traced, and forwarded to your
ISP for cancellation of your account. Go ahead, make my day!

Dennis Shinn

unread,
Mar 31, 1997, 3:00:00 AM3/31/97
to

Priva...@noplace.com (Private Ice) wrote:

>cad...@pivot.net (Mike Cundiff) wrote:

.....

message deleted ,.....


>>Mike Cundiff
>>Utilities, Inc.
>>www.pivot.net/~cadmike

> You are Utilities, Inc. and YOU want a utility so that I assume you
>can sell.

"Utilities" means more than simply addons to a piece of software. There are
electric utilities, there are water and sewer utilities ... etc. Few of these
are, to my knowedge, in the business to sell software.

> I've got an idea, why don't you

> 1. Learn how to do it yourself.

One of the biggest advantages of a medium like this is to share what we've
learned from others in a like manner. I'm greatful to the likes of the AutoLISP
pros that frequent this group and offer their help to the rest of us asking
nothing in return. I'm somewhat confident that they also learned much of what
they know in a similar manner. Thus rather than simply blowing someone off with
that kind of a statement, give some guidance on how to get started. It's not
necessary to solve the problem entirely but a little advice on how the pieces
fit together would go a lot further towards helping out.

> 2. Pay someone to do it, seeing as you are going to sell it.

You have nothing to base that on that I can see from the original post.



> I'm trying not to get pissed off here, but it's pretty difficult.

I fail to see any reason to be pissed off, or even slightly annoyed.


> Private Ice

Most professionals post in this group with a real name.


Dennis Shinn
Seattle AutoCAD User Group
CAD Systems manager/GLY Construction
Part No. ||| ||||| || ||||||


0 new messages