Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Json weird date format
Message
De
21/10/2020 00:35:08
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Web Services
Divers
Thread ID:
01676446
Message ID:
01676763
Vues:
45
>It's an old Microsoft specific format. They used this for various service implementation (WCF REST) and the ASP.NET based ASHX and Page services). The value is a JavaScript data ticks since 1970.
>
>I have code to parse this as part in wwJsonSerializer (which handles this automatically). Here's the relevant bit (you can remove the GetTimeZone() and do that conversion on your own after you get the final date - the date will be UTC).
>
>
>*** MS AJAX Date Format: "\/Date(1012341)\/"
>IF lcDate = ["\/] OR lcDate = ["\\/]
>   lnMSecs = VAL(STREXTRACT(lcDate,"Date(",")"))
>   RETURN {^1970/01/01 0:0} - (GetTimeZone() * 60) +  (lnMSecs/1000) 
>ENDIF
>
>
>
>+++ Rick ---
>
>>Hi, Im developing a small interface between and VFP9 desktop application and a web service. This WS needs to send it some data en Json format, 95% of the data can be generated without problems, but some date data require a weird format. Below is an example
>>
>>/Date(1579669200000-0500)/
>>
>>I googled and couldn't find anything that can generate that weird format using VFP.
>>
>>Any suggestions.
>>
>>TIA
>>
>>Luis

Thanks, Rick. I finally got the VFP version and know where it originated.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform