Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getPageInfo returns an incorrect modification date #23

Open
flohmueller opened this issue Mar 26, 2015 · 2 comments
Open

getPageInfo returns an incorrect modification date #23

flohmueller opened this issue Mar 26, 2015 · 2 comments

Comments

@flohmueller
Copy link

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 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").

  1. date -> string without timezone
  2. add timezone information (we know DokuWiki's output is in GMT)
  3. 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.

@flohmueller
Copy link
Author

fyi: I just opened an issue here

@gturri
Copy link
Owner

gturri commented Mar 26, 2015

Thanks a lot for this info!

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!

@gturri gturri mentioned this issue Mar 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants