Java Time Format getCurDateTimeFormat(String Format)

Here you can find the source of getCurDateTimeFormat(String Format)

Description

get Cur Date Time Format

License

Apache License

Declaration

public static String getCurDateTimeFormat(String Format) 

Method Source Code


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

import java.text.DateFormat;

import java.text.SimpleDateFormat;
import java.util.Calendar;

import java.util.TimeZone;

public class Main {

    public static String getCurDateTimeFormat(String Format) {
        Calendar now = Calendar.getInstance(TimeZone.getDefault());
        DateFormat sdf = new SimpleDateFormat(Format);
        sdf.setTimeZone(TimeZone.getDefault());
        return (sdf.format(now.getTime()));
    }//w  w  w .  j  a v  a 2 s .  com
}

Related

  1. formatToTimeStr(String str)
  2. formatUptime(long uptime)
  3. formatVideoRecordingTime(long t)
  4. getCalendarByDateTime(int dateTime, String dateFormat)
  5. getCurDateTime(String formatStr)
  6. getCurrDatetimeWithDbFormat()
  7. getCurTime(String dateformat)
  8. getDefaultDatetimeFormat()
  9. getDefaultPropertyPageDateTimeFormat()