Android Date Format String Create getMySQLDateFormat()

Here you can find the source of getMySQLDateFormat()

Description

get My SQL Date Format

Declaration

public static String getMySQLDateFormat() 

Method Source Code

//package com.java2s;
import java.util.Calendar;

public class Main {
    public static String getMySQLDateFormat() {

        //Membuat string tanggal sekarang
        Calendar now = Calendar.getInstance();
        int month = now.get(Calendar.MONTH) + 1;
        int day = now.get(Calendar.DAY_OF_MONTH);
        int year = now.get(Calendar.YEAR);

        return year + "-" + month + "-" + day;

    }//from   w  w  w .j av a2  s.  c o  m
}

Related

  1. getGMTDateFormat()
  2. getSimpleDateFormat()
  3. getSimpleDateFormatter()
  4. getDateByFormat(String strDate, String format)
  5. getStringByFormat(String strDate, String format)