Author Topic: -={ Challenge }=- Doomsday Algorithm  (Read 12955 times)

0 Members and 1 Guest are viewing this topic.

AIberto

  • Guest
Re: -={ Challenge }=- Doomsday Algorithm
« Reply #30 on: July 08, 2015, 08:49:49 AM »
Excellent  8-)


Dear Lee
I know the current Date  20150708 ,  3 days later is 20150711
I want know the Date at 200 days later... , How write this ?
Thanks.

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: -={ Challenge }=- Doomsday Algorithm
« Reply #31 on: July 08, 2015, 01:17:17 PM »
I know the current Date  20150708 ,  3 days later is 20150711
I want know the Date at 200 days later... , How write this ?

This is probably the easiest way:
Code - Auto/Visual Lisp: [Select]
  1. (menucmd "m=$(edtime,$(+,$(getvar,date),200),YYYYMODD)")

AIberto

  • Guest
Re: -={ Challenge }=- Doomsday Algorithm
« Reply #32 on: July 09, 2015, 02:49:13 AM »
I know the current Date  20150708 ,  3 days later is 20150711
I want know the Date at 200 days later... , How write this ?

This is probably the easiest way:
Code - Auto/Visual Lisp: [Select]
  1. (menucmd "m=$(edtime,$(+,$(getvar,date),200),YYYYMODD)")

Lee, Inconceivable! 

The current Date is Local time ?  Can I use your  Internet time function ? (LM:InternetTime "YYYYMODD")


Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: -={ Challenge }=- Doomsday Algorithm
« Reply #33 on: July 09, 2015, 06:45:24 AM »
I know the current Date  20150708 ,  3 days later is 20150711
I want know the Date at 200 days later... , How write this ?

This is probably the easiest way:
Code - Auto/Visual Lisp: [Select]
  1. (menucmd "m=$(edtime,$(+,$(getvar,date),200),YYYYMODD)")

Lee, Inconceivable! 

The current Date is Local time ?  Can I use your  Internet time function ? (LM:InternetTime "YYYYMODD")

Yes  :-)

AIberto

  • Guest
Re: -={ Challenge }=- Doomsday Algorithm
« Reply #34 on: July 09, 2015, 07:07:38 AM »
Lee ,Thanks,
But
like this ?
(menucmd "m=$(edtime,$(+,$(getvar,date),200),YYYYMODD)")
==>
(menucmd "m=$(edtime,$(+,(LM:InternetTime "YYYYMODD"),200),YYYYMODD)")

? ERROR

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: -={ Challenge }=- Doomsday Algorithm
« Reply #35 on: July 09, 2015, 08:43:40 AM »
No, you will need to either retrieve the Julian Date from the internet time server, add 200, and pass it to the edtime DIESEL function; or convert the date returned by my LM:InternetTime function to a Julian Date, before adding 200 and passing the resulting value to the edtime DIESEL function.

Lee

AIberto

  • Guest
Re: -={ Challenge }=- Doomsday Algorithm
« Reply #36 on: July 09, 2015, 09:45:11 AM »
No, you will need to either retrieve the Julian Date from the internet time server, add 200, and pass it to the edtime DIESEL function; or convert the date returned by my LM:InternetTime function to a Julian Date, before adding 200 and passing the resulting value to the edtime DIESEL function.

Lee

Sorry , Lee , I can't understand.

AIberto

  • Guest
Re: -={ Challenge }=- Doomsday Algorithm
« Reply #37 on: July 09, 2015, 08:29:46 PM »
Lee , I think I understand that "Julian Date " 
Thank you.

1.Manual Conversion
http://www.iasfbo.inaf.it/~mauro/JD/
DD/MM/YYYY 10/7/2015
==> Julian Day
2457214

_1$ (menucmd "m=$(edtime,$(+,2457214,200),YYYYMODD)")
"20160126"

2.  Conversion by function
_$ (setq tm (LM:InternetTime "YYYYMODD"))
"20150710"

_$ (setvar "userr1" (DTOJ (atof tm)));;  convert the date returned by LM:InternetTime function to a Julian Date
2.45721e+006

_$ (menucmd "m=$(edtime,$(+,$(getvar,userr1),200),YYYYMODD)")
"20160126"
_$

Lee, any suggest ? Thank you.
« Last Edit: July 10, 2015, 12:36:19 AM by AIberto »

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: -={ Challenge }=- Doomsday Algorithm
« Reply #38 on: July 10, 2015, 04:01:14 AM »
Tip: Use strcat to build the string for menucmd...

AIberto

  • Guest
Re: -={ Challenge }=- Doomsday Algorithm
« Reply #39 on: July 10, 2015, 11:39:47 AM »
Tip: Use strcat to build the string for menucmd...

?? example ?

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: -={ Challenge }=- Doomsday Algorithm
« Reply #40 on: July 10, 2015, 10:20:52 PM »
STRCAT
http://www.theswamp.org/~john/avlisp/#strcat
http://help.autodesk.com/view/ACD/2016/ENU/?guid=GUID-4430B1BF-DBB5-49D1-98F9-711B480976A1

What do you want the result to look like ?
What component pieces do you want to assemble ?
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: -={ Challenge }=- Doomsday Algorithm
« Reply #41 on: July 11, 2015, 04:06:34 AM »
Tip: Use strcat to build the string for menucmd...

?? example ?
Code - Auto/Visual Lisp: [Select]
  1. (setq tm (LM:InternetTime "YYYYMODD"))
  2. (setq tm (DTOJ (atof tm)))
  3.   (strcat
  4.     "m=$(edtime,$(+,"
  5.     (rtos tm 2 0)
  6.     ",200),YYYYMODD)"
  7.   )
  8. )

AIberto

  • Guest
Re: -={ Challenge }=- Doomsday Algorithm
« Reply #42 on: July 11, 2015, 04:58:46 AM »
Tip: Use strcat to build the string for menucmd...

?? example ?
Code - Auto/Visual Lisp: [Select]
  1. (setq tm (LM:InternetTime "YYYYMODD"))
  2. (setq tm (DTOJ (atof tm)))
  3.   (strcat
  4.     "m=$(edtime,$(+,"
  5.     (rtos tm 2 0)
  6.     ",200),YYYYMODD)"
  7.   )
  8. )


Very thanks ,roy , This is a good idea.  :laugh: