A field stores a timestamp in standard TiddlyWiki format.
I want to add/ subtract a predetermined time from that.
So, 20211112160000000 after adding 9 hours becomes 20211113010000000, etc.
How do I do that?
A field stores a timestamp in standard TiddlyWiki format.
I want to add/ subtract a predetermined time from that.
So, 20211112160000000 after adding 9 hours becomes 20211113010000000, etc.
How do I do that?
To do date and time addition the the complexity can get quite high. Have a look for plugins that do this. You can start at Eric’s Timer Tools or uses the Formula plugin and others.
If you are doing this just to handle time zones its unnecessary because you can use the UTC format.
I will see if I can share some links and other resources tomorrow +12 hours.
As Tony notes, adding a time “offset” to a given datetime value is complicated. The reason is that, although a datetime value is composed of numeric digits, it’s not a decimal number, so simple arithmetic is not sufficient.
A similar question was asked in the GoogleGroup back in July of this year, for which I posted an explanation of the complexity, as well as macro code that does the work to handle the needed math.
Here’s my response from then:
https://groups.google.com/g/tiddlywiki/c/uB1RxGj2qz0/m/aULGi1V9AgAJ
Also here
Which despite the unpromising title also ends on date manipulation thoughts.