How would this actually work? (looking for the same thing)

I tried <<g 2019 11 14>> and got an answer of 738908.3635 
<http://127.0.0.1:8080/#738908.3635>


Thanks 
- Dave

On Tuesday, August 20, 2019 at 1:18:41 PM UTC-6, Mat wrote:
>
> Hi Mark
>
> I found this algo
>
>
> https://web.archive.org/web/20170507133619/https://alcor.concordia.ca/~gpkatch/gdate-algorithm.html
>
> It should be enough with our new math functions. As an experiment I made 
> the first part (the g function):
>
> \define g(y, m, d)
> <$set name=m value={{{ [[$m$]add[9]remainder[12]] }}}>
> <$set name=y value={{{ [<m>divide[10]subtract[$y$]negate[]] }}}>
> <$set name=y4 value={{{ [<y>add[4]] }}}>
> <$set name=y100 value={{{ [<y>divide[100]] }}}>
> <$set name=y400 value={{{ [<y>divide[400]] }}}>
> <$set name=m3 value={{{ [<m>multiply[306]add[5]divide[10]] }}}>
> {{{ 
> [[365]multiply<y>add<y4>subtract<y100>add<y400>add<m3>add[$d$]subtract[1]] 
> }}}
> </$set></$set></$set></$set></$set></$set>
> \end
>
> This seems to work but it is only half of what is needed so I can't tell 
> for sure. What you're asking for is
>
>  d(g(y,m,d) + n)
>
>
> which thus requires the d function and maybe also to mess a bit with the 
> <<now>> macro to extract the desired bits. Or maybe it could be integrated 
> into the function for a more elegant solution.
>
> Tell me if you need more help and I'll fiddle a bit more. I'm a bit heavy 
> on work for some time but I'm a tiddly junkie so small and well defined 
> bits like these...
>
> <:-)
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/3829aead-4b21-4534-98fc-045902a1dc1f%40googlegroups.com.

Reply via email to