meetuparchive / apple-of-my-iap

Apple In-App Purchase Client and Mock Service
MIT License
30 stars 8 forks source link

Fix timezone craziness #5

Closed hchargois closed 8 years ago

hchargois commented 8 years ago

Hi! Thanks for your wonderful tool! However, being in the Europe/Paris timezone, I noticed that dates were off in the verifyReceipt responses... I saw that US/Eastern was hardcoded, so I tried replacing it with Europe/Paris and it worked OK, but I thought that wasn't a good solution to use hardcoded timezones... I noticed that in the subscriptions.txt the times were always OK, regardless of the hardcoded timezone: they are the actual UTC times, well-formed with a correct 'Z' timezone indicator at the end, so I figured all that timezone conversion was obviously unnecessary. You never have to convert dates between timezones, simply output them in the UTC timezone (instead of the system's default local timezone), which can easily be done with the SimpleDateFormat set to UTC. No need for joda-time either.

Anyways, this seems to work but I know nothing of Scala so I hope the code is correct enough... Cheers.