java - I want to Change Date Format -
i want change date 3 7 2015 3aug 2015
i have date value :
int day=3,month =7 ,year =2015
it's simple try below sample code :-
import java.text.simpledateformat; import java.util.calendar; public class dateformatter { public static void main(string[] args) { calendar cal = calendar.getinstance(); cal.set(2015, 7, 3); simpledateformat sdf = new simpledateformat("dmmm yyyy"); system.out.println("formatted date : " + sdf.format(cal.gettime())); } }
output
formatted date : 3aug 2015
Comments
Post a Comment