java - Is there a other way to get system date? -


im using intellij idea. when run on cmder, displays this:

output: tue may 31 00:00:00 sgt 2011

but want: 2017/09/14

code:

serverdate = new date ();  java.text.dateformat formatter = new java.text.simpledateformat("yyyy/mm/dd"); java.util.date newdate = new java.util.date(); string rawserverdate = (formatter.format(newdate )); serverdate = formatter.parse(rawserverdate);  

i return value in date data type.


Comments

Popular posts from this blog

ios - MKAnnotationView layer is not of expected type: MKLayer -

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -