get Calendar Header in E, dd MMM yyyy format - Android java.util

Android examples for java.util:Calendar Format

Description

get Calendar Header in E, dd MMM yyyy format

Demo Code


//package com.java2s;

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    public static String DateToStr;

    public static String getCalendarHeader() {
        Date curDate = new Date();
        SimpleDateFormat format = new SimpleDateFormat();
        DateToStr = format.format(curDate);

        format = new SimpleDateFormat("E, dd MMM yyyy");
        DateToStr = format.format(curDate);
        setCalendarHeader(DateToStr);//  www . j  a v  a2s .  com
        return DateToStr;
    }

    public static void setCalendarHeader(String dateToString) {
        DateToStr = dateToString;
    }
}

Related Tutorials