Convert string to date

Actually, Rob, that did not work for me either.  It appears that the GMT+00:00 is what is causing the issue.

From what I can see, I don’t think %w+ will capture all that.

I just changed the pattern to:

"%w+%s+(%w+)%s+(%d+)%s+(%d+)%:(%d+)%:(%d+)%s+(.+)%s+(%d+)"

(substituting a . for the %w ) and then it works.  But not sure if there are other possible date string formats that might come back from Google Play (different GEO stores perhaps?) that this would then break on.

Thanks a lot thegdog !

I also followed the tutorial about IAP and got stucked with this date format problem.

Good that I started another search and found your post :slight_smile:

I just hope that this will not cause any other problems in other timezones or places on the earth or what ever AND, that Robs code will not cause his games to break :wink:

Cheers, Felix

Glad it helped!

I will say that after thinking it over, I decided to remove that from my code.  I just wasn’t sure what the real need for it was.  Instead, I went with setting a variable when the “Restore purchases” button is pressed, and then just reset that when my store screen goes away or if the user presses a “Purchase” button.

I just found that an easier way to test if the “purchased” return value was an actual purchase or a restored purchase.  And it wouldn’t have any issues with different GEO stores (that I may never know about).

I also was wondering if my game need that part of code at all.

I only want to unlock some feature if the player paid it once, even if he is at another mobile or removed all files of the game.

If I understood right, than I simply make store.restore and if the player ever bought this feature, than it should return that he purchased this and this is what I want to know.

I am just starting with IAP and its lots of new things to think about and care for…

Thanks again for the reply.

Thanks a lot thegdog !

I also followed the tutorial about IAP and got stucked with this date format problem.

Good that I started another search and found your post :slight_smile:

I just hope that this will not cause any other problems in other timezones or places on the earth or what ever AND, that Robs code will not cause his games to break :wink:

Cheers, Felix

Glad it helped!

I will say that after thinking it over, I decided to remove that from my code.  I just wasn’t sure what the real need for it was.  Instead, I went with setting a variable when the “Restore purchases” button is pressed, and then just reset that when my store screen goes away or if the user presses a “Purchase” button.

I just found that an easier way to test if the “purchased” return value was an actual purchase or a restored purchase.  And it wouldn’t have any issues with different GEO stores (that I may never know about).

I also was wondering if my game need that part of code at all.

I only want to unlock some feature if the player paid it once, even if he is at another mobile or removed all files of the game.

If I understood right, than I simply make store.restore and if the player ever bought this feature, than it should return that he purchased this and this is what I want to know.

I am just starting with IAP and its lots of new things to think about and care for…

Thanks again for the reply.

None of these fixes helped until I followed thegdog’s advice and just removed the time checking. Like him, I just set flags for when a restore was appropriate or not. 

None of these fixes helped until I followed thegdog’s advice and just removed the time checking. Like him, I just set flags for when a restore was appropriate or not.