string - Calculating Date in Java -


ok trying create date in format:

simpledateformat dateformat = new simpledateformat("dd-mm-yy"); 

i having trouble calculating date gives me 1/1/13.

date newdate = new date (136199001); string date = dateformat.format(newdate); 

however can't work out how desired date. know suppose work out 01/01/70 having trouble. question : formula work date out?

you can use calendar object specific date. easier.

calendar cal = calendar.getinstance(); cal.set(2013, 0, 1); //1st january 2013 date date = cal.gettime(); simpledateformat dateformat = new simpledateformat("dd-mm-yy"); string datestr = dateformat.format(date); 

Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -