Here you can find the source of parseBitcoin(String calendarString)
public static Calendar parseBitcoin(String calendarString)
//package com.java2s; //License from project: Apache License import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; public class Main { private static DateFormat bitcoinFormatter = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); public static Calendar parseBitcoin(String calendarString) { try {/*from w ww .j a va2s . c om*/ Date date = bitcoinFormatter.parse(calendarString); Calendar cal = new GregorianCalendar(); cal.setTime(date); return cal; } catch (ParseException e) { e.printStackTrace(); } return null; } public static Calendar parse(String calendarString) { try { Date date = getDateFormat().parse(calendarString); Calendar cal = new GregorianCalendar(); cal.setTime(date); return cal; } catch (ParseException e) { e.printStackTrace(); } return null; } private static DateFormat getDateFormat() { DateFormat formatter = new SimpleDateFormat("MM/dd/yyyy"); return formatter; } }