Take the 2-minute tour ×

I am writing a Java servlet that will verify whether Apple receipt-date from an iOS in-app purchase is valid or not, and to get a receipt object to return to the iOS client. The specification of this verification are in this page from the official iOS documentation.

In the verified and converted receipt object (a JSON returned to the servlet by Apple via HTTP Post), an example a date string is this: 2012-01-13 10:14:24 America/Los_Angeles. I want to write a Jackson JSON deserializer that will convert the String into a Joda DateTime object.

Problem: I am not sure whether the hour field of the timestamp is 0-based or 1-based. If it was 0-based, then I would create a DateTimeFormatter using HH to specify the hour field. Conversely, if it was 1-based, then I would use kk. Please see the Javadoc for DateTimeFormat for more info about how to write the timestamp configuration String.

Does anyone know whether the timestamp from Apple is 0-based or 1-based? As I do not yet have an active iTunes app (my test timestamp was from an example receipt), I am unable to write a test for this. Thank you!

share|improve this question
I'm almost certain that it's 0-based. –  zneak Nov 12 '12 at 17:18
add comment

1 Answer

up vote 2 down vote accepted

From: Verifying Store Receipts you can get that purchase_date is a transactionDate, and transactionDate NSDate. From Date Formatters you can see that the used hour format is HH:mm.

share|improve this answer
add comment

Your Answer


