Java Parse Date Pattern YYYY parseApplePurchaseDate(String dateStr)

Here you can find the source of parseApplePurchaseDate(String dateStr)

Description

Apple IAP receipt purchase date string format: "purchase-date-pst" = "2012-07-12 05:54:35 America/Los_Angeles";

License

Apache License

Parameter

Parameter Description
dateStr a parameter

Declaration

public static final Date parseApplePurchaseDate(String dateStr) 

Method Source Code


//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;
    }
}

Related

  1. parse(String time)
  2. parse(String time, String df)
  3. parse1(String DateString, String dateTimeSeparator)
  4. parse2DateString(String date)
  5. parse_default(String time)
  6. parseArgument(String textDate)
  7. parseAscTime(String date)
  8. parseAsDateTime(String date)
  9. parseAtomDate(String date_str)