Java Timestamp Convert To convertTimestampToDDMMMMYYYY(Timestamp dateTime)

Here you can find the source of convertTimestampToDDMMMMYYYY(Timestamp dateTime)

Description

convert timestamp to format dd MMMM yyyy

License

LGPL

Parameter

Parameter Description
dateTime a parameter

Return

String

Declaration

public static String convertTimestampToDDMMMMYYYY(Timestamp dateTime) 

Method Source Code


//package com.java2s;
//License from project: LGPL 

import java.sql.Timestamp;

public class Main {
    /**/*from  w  w w .j  a va 2  s . c om*/
     * convert timestamp to format dd MMMM yyyy
     * @param dateTime
     * @return String
     */
    public static String convertTimestampToDDMMMMYYYY(Timestamp dateTime) {
        String s = "";
        java.text.SimpleDateFormat ft = null;
        ft = new java.text.SimpleDateFormat("dd MMMM yyyy");
        s = ft.format(dateTime);
        if (s.indexOf("Jan") > -1) {
            s = s.replace("January", "Januari");
        } else if (s.indexOf("Feb") > -1) {
            s = s.replace("February", "Februari");
        } else if (s.indexOf("Mar") > -1) {
            s = s.replace("March", "Maret");
        } else if (s.indexOf("May") > -1) {
            s = s.replace("May", "Mei");
        } else if (s.indexOf("Jun") > -1) {
            s = s.replace("June", "Juni");
        } else if (s.indexOf("Jul") > -1) {
            s = s.replace("Jul", "Juli");
        } else if (s.indexOf("Aug") > -1) {
            s = s.replace("August", "Agustus");
        } else if (s.indexOf("Oct") > -1) {
            s = s.replace("October", "Oktober");
        } else if (s.indexOf("Feb") > -1) {
            s = s.replace("November", "Nopember");
        } else if (s.indexOf("Dec") > -1) {
            s = s.replace("December", "Desember");
        }
        return s;
    }
}

Related

  1. convertDate(Timestamp time)
  2. ConvertTimestamp(long sec)
  3. convertTimestamp(Timestamp timestamp)
  4. convertTimestampToDate(Timestamp timestamp)
  5. convertTimestampToString(Timestamp dateTime, String dateFormat)
  6. convertTimestampToString(Timestamp str)
  7. convertTimestampToStringWithoutTime(final Timestamp ts)
  8. convertToDate(Timestamp aTimeStamp)