Here you can find the source of parseApplePurchaseDate(String dateStr)
Parameter | Description |
---|---|
dateStr | a parameter |
public static final Date parseApplePurchaseDate(String dateStr)
//package com.java2s; //License from project: Apache License import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { private static final SimpleDateFormat SDF_APPLE = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); /**//from ww w . j a v a 2 s.c o m * Apple IAP receipt purchase date string format: * "purchase-date-pst" = "2012-07-12 05:54:35 America/Los_Angeles"; * * @param dateStr * @return */ public static final Date parseApplePurchaseDate(String dateStr) { try { Date date = SDF_APPLE.parse(dateStr); return date; } catch (ParseException e) { } return null; } }