java - getformat for showing week -
how can set datetimeformat show this: "wed.-sun." "mon.-sun." "mon.-sun." "mon.-sun." "mon.-tue"
datetimeformat dtfdate = datetimeformat.getformat("dd.mm"); if (rt.detalization.equals("date")) { dtfdate = datetimeformat.getformat("dd.mm"); } if (rt.detalization.equals("week")) { dtfdate = datetimeformat.getformat("eee.dd-eee.dd"); //how can show week choisen day sunday wrote before } if (rt.detalization.equals("month")) { dtfdate = datetimeformat.getformat("mmm"); }
the below code prints
datetimeformat format2 = datetimeformat.getformat("e"); string format = format2.format(new date()); system.out.println(format); //prints "mon"
so
if (rt.detalization.equals("week")) { datetimeformat format2 = datetimeformat.getformat("e"); string day= format2.format(dtfdate); system.out.println(day+"-sun"); }
Comments
Post a Comment