Java String to Time getTime(String pattern)

Here you can find the source of getTime(String pattern)

Description

get Time

License

Apache License

Declaration

public static String getTime(String pattern) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    public static SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");

    public static String getTime(String pattern) {
        return new SimpleDateFormat(pattern).format(new Date());
    }/*w w w .j  a v  a2  s  .  c om*/
}

Related

  1. getTime(String date)
  2. getTime(String date, String pattern)
  3. getTime(String dateTimeString)
  4. getTime(String file)
  5. getTime(String parrten)
  6. getTime(String pattern)
  7. getTime(String s)
  8. getTime(String sDateTime, String eDateTime)
  9. getTime(String time)