Convert New function into String Date

Convert New function into String Date

Anonymous
Not applicable
270 Views
5 Replies
Message 1 of 6

Convert New function into String Date

Anonymous
Not applicable
Hi,
I'm trying to know how can I convert for example by reading the New function this is what I get 36979.5 and I want to translate this real number into this 3/29/2000 1:18:05, or at least know what the number means.

Thank you,
Luis Esquivel
0 Likes
271 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable
I'm gonna guess you're referring to the Now function, not the New operator. If
so, try this:

Format(Now, "Long Date")

--
http://www.acadx.com
Win a free autographed copy of
"AutoCAD 2000 VBA Programmer's Reference"

"Luis_Esquivel" wrote in message
news:f03b700.-1@WebX.maYIadrTaRb...
> Hi,
> I'm trying to know how can I convert for example by reading the New function
this is what I get 36979.5 and I want to translate this real number into this
3/29/2000 1:18:05, or at least know what the number means.
> Thank you,
> Luis Esquivel
>
>
0 Likes
Message 3 of 6

Anonymous
Not applicable
Thank you Frank,

Actually what I want it to know is what is the real number that this function returns 36979.5, so I can make with the cdate autocad system variable a function to return a number like this.

Regards,
Luis Esquivel
0 Likes
Message 4 of 6

Anonymous
Not applicable
OleDates represent the elapsed time since Dec. 30, 1899. The integer
portion represents the number of elapsed days while the decimal
portion represents the number of hours that have elapsed in that day
( 0 = midnight, .5 = noon).

Although, you might be taking the long way around: CDATE is neither a
Julian nor an OleDate but simply the current date and time formatted
into a number (YYYYMMDD.HHMMSShsec).

--
http://www.acadx.com
Win a free autographed copy of
"AutoCAD 2000 VBA Programmer's Reference"
by Joe Sutphin

"Luis_Esquivel" wrote in message
news:f03b700.1@WebX.maYIadrTaRb...
Thank you Frank,
Actually what I want it to know is what is the real number that this
function returns 36979.5, so I can make with the cdate autocad system
variable a function to return a number like this.
Regards,
Luis Esquivel
0 Likes
Message 5 of 6

Anonymous
Not applicable
Thank you frank,

What I'm doing is that I want to use and activex control call "activelock", and one of the properties (vlax-get-property obj 'LastRunDate) returns the type of number you mention I just want to compare this with the actual date, but the problem I have is that how can I convert the cdate to this.

Thanks,
Luis Esquivel
0 Likes
Message 6 of 6

Anonymous
Not applicable
Using Stephan's advice, converting the OleDate returned by ActiveLock
to a Julian date is as simple as adding 2415019 to it. You can then
compare that value to the one returned by (getvar "DATE"). No need for
CDATE or any additional conversion. Good luck.

P.S. Thanks for turning me on to ActiveLock. It looks quite useful.

--
http://www.acadx.com
Win a free autographed copy of
"AutoCAD 2000 VBA Programmer's Reference"
by Joe Sutphin

"Luis_Esquivel" wrote in message
news:f03b700.3@WebX.maYIadrTaRb...
Thank you frank,
What I'm doing is that I want to use and activex control call
"activelock", and one of the properties (vlax-get-property obj
'LastRunDate) returns the type of number you mention I just want to
compare this with the actual date, but the problem I have is that how
can I convert the cdate to this.
Thanks,
Luis Esquivel
0 Likes