datetime - How to pass the date into GregorianCalendar in JAVA? -


sorry, new this.

this class private string name; private string code; private gregoriancalendar startdatetime; private gregoriancalendar enddatetime; 

this main coursedetail []c1={new course("java","aacs 2083", new gregoriancalendar(2015,06,20,14,00),new gregoriancalendar(2015,06,21,15,00))}; 

am close answer?

may ask how pass date gregoriancalendar using method above?? sorry dummy question...

you can directly use util date gregoriancalendar

date date = new date(); gregoriancalendar gregoriancalendar = new gregoriancalendar(); gregoriancalendar.settime(date); 

directly set date

gregoriancalendar gc = new gregoriancalendar(); gc.set(gregoriancalendar.year, 2015); gc.set(gregoriancalendar.month, 7); gc.set(gregoriancalendar.date, 23); 

constructors link

public gregoriancalendar(int year,                  int month,                  int dayofmonth)   public gregoriancalendar(int year,                  int month,                  int dayofmonth,                  int hourofday,                  int minute) 

example

gregoriancalendar calendar=new gregoriancalendar(2015, 6, 23,23, 12); 

Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

Nuget pack csproj using nuspec -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -