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
Post a Comment