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

unix - grep command not match start of new line with another regex -

sql - calculate weighted average for each day and id based on time intervals in PostgreSQL -

Sort a complex associative array in PHP -