|XML-RPC, postevent, time zone
||[Jan. 9th, 2006|03:48 pm]
LiveJournal Client Discussions
I have a client ( blog posting functionality on http://imageshack.us/ ) which creates new posts using XML-RPC protocol. it is web-based and clients come from different time zones. However time in 'postevent' method should be specified in user time zone. I see no way to get programmatically user time zone from livejournal. Neither I see a way to specify time zone in postevent call in XML-RPC.|
I've read somewhere that there is undocumented parameter 'TZ' in flat protocol which allows you to specify time zone. I've tried to add it to my XML-RPC request, but it does not work.
To me it looks like very serious protocol deficiency. It asks to provide information from user profile which I have to way to retrieve. It would be stupid for my to ask user for his time zone in UI each time. Are there any workarounds? What other client developers do? Nobody uses XML-RPC protocol anymore?
That's what I did. I have passed 'tz' with value '+0000' to specify GMT. However my post date shows
wrong date (It shows GMT date, but since my journal is set up in PDT I expect it to convert it to PDT when showing to me).
I am using XMLRPC protocol. Maybe 'tz' option works only for 'flat' protocol?
So that's just display issue? My main problem is that I was getting errors because entry was backdated because of this timezone problem. So if I would add 'tz' variable it would still display it wrong in some journals, but would not give me errors because some entries posted via LJ web interface are considered newer?
Ok, I did some more digging, and here is what I found in the source code.
1. If you specify some date in postevent, 'tz' value other than 'guess' is ignored!
2. If you omit date value and specify numeric tz (+/-\d\d\d\d) then server would take current time, adds this time zone offset (*360) and convert result to GMT
That does not brings me any closer to solution. All I want to do is to add post for user with current instant posting date. If I omit date values and specify '+0000' as 'tz' (GMT) the date of post on the web page is shown in GMT. Which perhaps is accetpable, but when I log in to via web interface and try to add second post, it says there was post in future, and this new one should be backdated!
Frankly it looks like a big mess. Should be an easy and simple way just add entry to the journal marked with current time whatever it is according to the server clock?!