JAVA Date string without symbols -


this question has answer here:

i'm formatting date string without symbols :,/,- using simpledateformat, formats strangely.

here's code :

public static string getformateddate(date date, string format) {     simpledateformat simpledateformat = new simpledateformat(format);     return simpledateformat.format(date); } 

and call :

dateutil.getformateddate(new date(), "ddmmyyyyhhmmss") 

return of call incorrect 2540920170909379 should 11092017093405 = 11/09/2017 09:34:05

try following;

dateutil.getformateddate(new date(), "ddmmyyyyhhmmss"); 

see java doc complete format


Comments

Popular posts from this blog

Sort a complex associative array in PHP -

vb.net - How to ignore if a cell is empty nothing -

recursion - Can every recursive algorithm be improved with dynamic programming? -