I use `$edit-date’ to set date and time. I can select a date and time and all seems to be well.
But once set, TiddlyWiki interprets the date as UTC whereas I follow UTC+0530, IST.
So, if I set the timestamp as 202111070000000 whereas I meant it to be IST, TiddlyWiki considers it as UTC and therefore, displays the timestamp to be 202111070530000.
How do I solve this problem? I want to be able to set the time in UTC. TiddlyWiki will then make the necessary timezone adjustments while displaying the time.
If this means that I will have to use some other date picker, please let me know.
At a more general level, how do you handle timestamps? Storing and displaying?
Generally the time fields in TW want a UTC time, but will display your local time.
For my own timestamp fields, I usually use yyyy-mm-dd which is local, sortable, easy to read and write, and doesn’t cause the headaches UTC time does. I almost never require the actual time of an event.
Modified and created dates are stored as UTC. Displayed with local time.
It’s mostly a problem with the sameday filter which promises that you can use YYYYMMDD as input. But this isn’t exactly true if put in your local date which it will see as the START of the equivalent UTC date. Or at least that’s how I’m remembering the issue.
For import/export, as long as you know what rules are being followed – the date will probably have to be adjusted to match that of the importing system anyways.
A total aside: until now, I had never really put much thought into the complexity of sharing time-stamped information across time zones, “offsets”, and how some places’ offsets are different (daylight savings time.)
America/Coral_Harbour is a time zone (for simplicity, I will focus only on IANA* time zones). America/Detroit is a time zone. With laws as they are now, the America/Coral_Harbour time zone has an unchanging offset of -0500, or five hours “behind” GMT, which for our purposes here matches UTC. America/Detroit changes during the year from an -0400 offset to an -0500 offset. So sometimes, the good people of Coral Harbour and the good people of Detroit have the same offset. Sometimes, they don’t.
It may not be rocket science, but I do appreciate (in a new light?) the automation any system does to figure out UTC time based on a date+time entered from any location. Pretty cool.