UPDATE:
I'm posting @vitro 's comment here:
Year 2021 - and it is there: https://developer.apple.com/documentation/appstorereceipts/expires_date_ms This field is returned in the JSON response, in the responseBody.Latest_receipt_info and responseBody.Receipt.In_app arrays.
The time a subscription expires or when it will renew, in UNIX epoch time format, in milliseconds. Use this time format for processing dates.
thx @vitro
ORIGINAL POST:
While verifying a renewable subscription receipt I am attempting to get the expiration date of the latest receipt.
According to the apple documentation on receipt fields the "expires_date" field should contain a number which is the number of milliseconds since January 1, 1970, 00:00:00 GMT.(https://developer.apple.com/library/ios/releasenotes/General/ValidateAppStoreReceipt/Chapters/ReceiptFields.html#//apple_ref/doc/uid/TP40010573-CH106-SW1)
When I fetch the field however i am receiving a string with a formatted date from the "expires_date" field. There is another field called "expires_date_ms" that seems to provide the correct data. Apple states "Keys not documented below are reserved for use by Apple and must be ignored by your app."
here is an example of my receipt:
{"quantity":"1",
"product_id":"com.testapp.test",
"transaction_id":"1000000135676121",
"original_transaction_id":"1000000135134855",
"purchase_date":"2014-12-15 06:53:54 Etc/GMT",
"purchase_date_ms":"1418626434059",
"purchase_date_pst":"2014-12-14 22:53:54 America/Los_Angeles",
"original_purchase_date":"2014-12-15 06:51:12 Etc/GMT",
"original_purchase_date_ms":"1418626272000",
"original_purchase_date_pst":"2014-12-14 22:51:12 America/Los_Angeles",
"expires_date":"2014-12-15 06:56:10 Etc/GMT",
"expires_date_ms":"1418626570000",
"expires_date_pst":"2014-12-14 22:56:10 America/Los_Angeles",
"web_order_line_item_id":"1000000028947356",
"is_trial_period":"false"
}]
Which field should i use to obtain the expired date with best practices?