You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had an issue regarding timestamp comparison between the modification timestamp from getPageInfo and another timestamp. The one to blame is not really the DokuJClient.. but here's what I found out:
In its RemoteAPICore.php->pageInfo function DokuWiki uses a date to string conversion which finally calls gmdate to extract year, month, day, hour, minute and second; thus, the result is in GMT.
The XMLRPC library you're using (de.timroes aXMLRPC) seems to parse the timestamp with the pattern yyyyMMdd'T'HH:mm:ss (see DateTimeSerializer), without a timezone.
That's fine, as there's no timezone information in the answer from DokuWiki. But without a timezone the resulting date is considered to be in the client's timezone.
So it's likely more an issue for the XMLRPC library... e.g. to set a custom DateTimeSerializer, a default timezone for the DateTimeSerializer, and/or a flag to include timezone parsing.
I don't know if you want to try to do anything about that issue.. at least it is documented now ;)
My workaround looks like this: new SimpleDateFormat("yyyyMMddHHmmssz").parse(new SimpleDateFormat("yyyyMMddHHmmss").format(modified) + "GMT").
date -> string without timezone
add timezone information (we know DokuWiki's output is in GMT)
parse again, this time including timezone information
Another workaround might be to tweak DokuWiki to output the modification date in the desired timezone.
In an ideal world, DokuWiki's date transformation would include timezone information which in turn would be parsed by the XMLRPC library's DateTimeSerializer.
The text was updated successfully, but these errors were encountered:
Indeed, I noticed several glitches regarding DateTime, but I never dived into it.
This will likely be valuable information when I'll try to improve time handling!
Hi Guillaume,
I had an issue regarding timestamp comparison between the modification timestamp from
getPageInfo
and another timestamp. The one to blame is not really the DokuJClient.. but here's what I found out:In its
RemoteAPICore.php->pageInfo
function DokuWiki uses a date to string conversion which finally callsgmdate
to extract year, month, day, hour, minute and second; thus, the result is in GMT.The XMLRPC library you're using (de.timroes aXMLRPC) seems to parse the timestamp with the pattern
yyyyMMdd'T'HH:mm:ss
(seeDateTimeSerializer
), without a timezone.That's fine, as there's no timezone information in the answer from DokuWiki. But without a timezone the resulting date is considered to be in the client's timezone.
So it's likely more an issue for the XMLRPC library... e.g. to set a custom
DateTimeSerializer
, a default timezone for theDateTimeSerializer
, and/or a flag to include timezone parsing.I don't know if you want to try to do anything about that issue.. at least it is documented now ;)
My workaround looks like this:
new SimpleDateFormat("yyyyMMddHHmmssz").parse(new SimpleDateFormat("yyyyMMddHHmmss").format(modified) + "GMT")
.Another workaround might be to tweak DokuWiki to output the modification date in the desired timezone.
In an ideal world, DokuWiki's date transformation would include timezone information which in turn would be parsed by the XMLRPC library's
DateTimeSerializer
.The text was updated successfully, but these errors were encountered: