0

Basically what I'm trying to do is using this api, api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=<key>&steamids=76561197960435530

and use the time created field and display it converted from UNIX time to regular time

This is some I code I have made

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Net;
    using Newtonsoft.Json;
    using Newtonsoft.Json.Linq;


    namespace JSONTest
    {
        class Program
        {
            static void Main(string[] args)
            {
                string SteamKey = // key

                WebClient c = new WebClient();
                var data = c.DownloadString("http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/" + "?key=" + SteamKey + "&steamids=76561197960435530");
               // Console.WriteLine(data);
                JObject o = JObject.Parse(data);
                Console.WriteLine("Name: " + o["response"]["players"][0]["timecreated"]);
                Console.ReadLine();


                // Prompt the user on what they want to do 

            }
        }
}

I have got it to display the field "timecreated" but I don't know how I would convert that to a Date. Pointers would be greatly appreciated.

cbr
  • 12,563
  • 3
  • 38
  • 63
John Douglas
  • 359
  • 2
  • 4
  • 12
  • 1
    You probably don't want to include your own API key in the question. It's prone to abuse if you publish it. – cbr Apr 05 '16 at 16:10
  • Thanks for removing that didn't even think about that! the problem I'm having is the fact that I don't how to convert the field time created because when I implement the function in to the code It won't work because that field has to be a string value. – John Douglas Apr 05 '16 at 21:29
  • Be sure to invalidate the old key. – cbr Apr 05 '16 at 21:31

0 Answers0