Overflow Stack
Overflow Stack

Reputation: 41

Convert expires_at filed from debug token in Facebook c# sdk

Hello I got a JsonObject by debug_token and I need to know what is expires_at / issued_at (What is the dataType) and how to convert it to C#'s DateTime.

Simply I need to know what Facebook means by expires_at. Is it the time (seconds/minutes) to its death or correct time format (DateTime)
I am using Facebook C# SDK

JSON array I got is:

{
    "data": {
        "app_id": *********,
        "is_valid": true,
        "application": "MyApp1",
        "user_id": *********,
        "issued_at": 1367606488,
        "expires_at": 1372790488,
        "scopes": [
            "create_note",
            "manage_notifications",
            "photo_upload",
            "publish_actions",
            "publish_stream",
            "read_stream",
            "share_item",
            "status_update",
            "user_about_me",
            "user_photos",
            "video_upload"
        ]
    }
}

Upvotes: 3

Views: 1006

Answers (1)

Raphael
Raphael

Reputation: 69

It's the time when the token gonna expire, in Unix Time format, as seen above:

Unix time (also known as POSIX time or Epoch time) is a system for describing instants in time, defined as the number of seconds that have elapsed since 00:00:00 Coordinated Universal Time (UTC), Thursday, 1 January 1970, not counting leap seconds. It is used widely in Unix-like and many other operating systems and file formats. Because it does not handle leap seconds, it is neither a linear representation of time nor a true representation of UTC. Unix time may be checked on most Unix systems by typing date +%s on the command line.

To check out there is a useful web site that convert this number into a readable date:

http://www.epochconverter.com/

Upvotes: 2

Related Questions