Json date format not converting - Python client - WCF Rest

Json date format not converting - Python client - WCF Rest

Postby surpavan » Mon Aug 25, 2014 7:49 am

My python code `print(msg)` prints the json data as:

Code: Select all
{'EndTime': '\\/Date(1408913087404+0530)\\/', 'SessionID': 'db84439f-303e-4c24-a23b-241a57ba0bdc', 'TestString': 'WORKING FINE'}


I took the date and time from it with code: `print(msg['EndTime'])` and the result is showing is as:

Code: Select all
\/Date(1408913087404+0530)\/


How can I get the correct date time format from it. The data is form WCF rest service with `DataContractJsonSerializer` and object type was DateTime, I want to format date into python default type, so why is it not converting to default type, I thought Json would convert on itself based on date type.
Last edited by Yoriz on Mon Aug 25, 2014 9:23 am, edited 1 time in total.
Reason: First post lock.
with regards
surpavan :)
surpavan
 
Posts: 3
Joined: Mon Aug 25, 2014 7:26 am

Re: Json date format not converting - Python client - WCF Re

Postby Yoriz » Mon Aug 25, 2014 9:24 am

Welcome to the forum, please read the new users link in my signature.
New Users, Read This
Join the #python-forum IRC channel on irc.freenode.net!
Spam topic disapproval technician
Windows7, Python 2.7.4., WxPython 2.9.5.0., some Python 3.3
User avatar
Yoriz
 
Posts: 831
Joined: Fri Feb 08, 2013 1:35 am
Location: UK

Re: Json date format not converting - Python client - WCF Re

Postby surpavan » Mon Aug 25, 2014 7:56 pm

Yoriz wrote:Welcome to the forum, please read the new users link in my signature.

Yup read that first.
with regards
surpavan :)
surpavan
 
Posts: 3
Joined: Mon Aug 25, 2014 7:26 am

Re: Json date format not converting - Python client - WCF Re

Postby micseydel » Mon Aug 25, 2014 11:09 pm

Yoriz wrote:Welcome to the forum, please read the new users link in my signature.

I'm not sure these replies are helpful, Yoriz.
Join the #python-forum IRC channel on irc.freenode.net!

Please do not PM members regarding questions which are meant to be discussed publicly. The point of the forum is so that others can benefit from it. We don't want to help you over PMs or emails.
User avatar
micseydel
 
Posts: 1354
Joined: Tue Feb 12, 2013 2:18 am
Location: Mountain View, CA

Re: Json date format not converting - Python client - WCF Re

Postby Yoriz » Tue Aug 26, 2014 12:41 am

You don't want me to welcome new user's and point them to the post that was made especially for them ? :cry:
Fair enough I won't bother any more, less for me to do when approving a new user's post :D
New Users, Read This
Join the #python-forum IRC channel on irc.freenode.net!
Spam topic disapproval technician
Windows7, Python 2.7.4., WxPython 2.9.5.0., some Python 3.3
User avatar
Yoriz
 
Posts: 831
Joined: Fri Feb 08, 2013 1:35 am
Location: UK

Re: Json date format not converting - Python client - WCF Re

Postby surpavan » Tue Aug 26, 2014 8:18 am

no offense from my side, just replied to your post, thats all. And waiting for a answer for my issue.
with regards
surpavan :)
surpavan
 
Posts: 3
Joined: Mon Aug 25, 2014 7:26 am


Return to Web Development

Who is online

Users browsing this forum: No registered users and 1 guest