confused about UTC term used for the dates

127 views
Skip to first unread message

Sebastian Ovide

unread,
Oct 30, 2019, 1:24:54 PM10/30/19
to TiddlyWiki
Hello all

TiddlyWiky stores dates in a format referred as UTC. Example: 20191030170157357. But the UTC is very common to see everywhere looks like 1994-11-05T13:15:30Z 

any idea on the reason of choosing that format ?

thanks

Mark S.

unread,
Oct 30, 2019, 1:39:46 PM10/30/19
to TiddlyWiki
That particular format doesn't include milliseconds. It is a 1000 times less precise than the TW format.
The time stamp may be important if you are generating more than 1 tiddler a second.

That's my theory, anyways ;-)

TonyM

unread,
Oct 30, 2019, 9:19:58 PM10/30/19
to TiddlyWiki
Sebastian

UTC does not refer to the format as you seem to believe, it refers to the dates time zone. UTC is the universal time held in Greenwich.

It's easy to be confused with this but the trick is to store the date time in UTC but when that time is displayed is converts to local time, using your browser locality settings and time zone. This allows your wiki to respond to local daylight savings, or when you work in another time zone, or you import tiddlers from another time zone.


Once you grasp that, return with any more detailed questions.

Regards
Tony

Sebastian Ovide

unread,
Oct 31, 2019, 4:05:24 AM10/31/19
to TiddlyWiki
Hi Tony

thanks for that.

I get the concept. My question was about the format that TW is using in the tiddlers. 

example. 

<$edit-text field="my_date" type="date"/>
<$edit-text field="my_datetime" type="datetime-local"/>

will create these fields:
created: 20191030080335371
modified
: 20191031080056713
my_date
: 2019-10-02
my_datetime
: 2019-10-03T11:01
title
: AAAAAA
using the the format by the browser using UTC (so your logic applies). 

so my specific question is about the reasoning behind choosing that format rather than the standard UTC ?

Just curious.

Regards

TonyM

unread,
Oct 31, 2019, 8:10:37 PM10/31/19
to TiddlyWiki
Why ?,

The type setting in edit-text sets the html type values and is not aware of tiddlywiki date formats. You can use them but you will need to work to use this format dates because you can't simply use javascript as you would on a typical html page.

The format used by tiddlywiki is more precise and numeric only. As a result you can test if one is greater than the other to compare which was first/last. The other date formats need further formatting to do any such comparisons. Look for the date picker plugin to select dates in tiddlywiki format. You can use the html format but you will need to translate it to something similar to do any processing on the dates. You can also make a date stamp button for now using the Now macro.

Using the view widget, format date and Now macro you can make tiddlywiki dates look like html dates.

Regards
Tony

Jeremy Ruston

unread,
Nov 1, 2019, 3:59:58 PM11/1/19
to tiddl...@googlegroups.com
Just to add that the date format for "1994-11-05T13:15:30Z" is called ISO-8601:

https://en.wikipedia.org/wiki/ISO_8601

The reason that TW uses the 20191031080056713 format is that it is easier to use for computations and comparisons.

Best wishes

Jeremy


On 1 Nov 2019, at 00:10, TonyM <anthony...@gmail.com> wrote:


--
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 tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/67434630-ed18-4dd2-88be-b038b2b59494%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages