Java: Converting 12 hour time to 24 hour time -


this question has answer here:

is there simple function convert time that's this: 10:30pm 17 aug 2016 nzst 2016-8-17-2230

import java.text.simpledateformat; import java.util.date;  public class main {    public static void main(string [] args) throws exception {        simpledateformat displayformat = new simpledateformat("yyyy-mm-dd-hhmm");         date date = new date();//current date         system.out.println(displayformat.format(date));    } }     see java documentation http://docs.oracle.com/javase/1.5.0/docs/api/java/text/simpledateformat.html 

Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -