Java Now getFormattedDateNow(@Nonnull final String sFormat)

Here you can find the source of getFormattedDateNow(@Nonnull final String sFormat)

Description

get Formatted Date Now

License

Open Source License

Declaration

@Nonnull
    public static String getFormattedDateNow(@Nonnull final String sFormat) 

Method Source Code


//package com.java2s;

import java.text.SimpleDateFormat;
import java.util.Date;
import javax.annotation.Nonnull;

public class Main {
    @Nonnull
    public static String getFormattedDateNow(@Nonnull final String sFormat) {
        return formatDate(sFormat, new Date());
    }//from  ww w .  ja va2 s.  c  om

    @Nonnull
    public static String formatDate(@Nonnull final String sFormat, @Nonnull final Date aValue) {
        return new SimpleDateFormat(sFormat).format(aValue);
    }
}

Related

  1. formatNow(String style)
  2. formatTime(Date now, String pattern)
  3. getAllnowTime()
  4. getDisplayDateNow()
  5. getFormatNowDateTime(String formatStr)
  6. getInviteCodeByNowDate()
  7. getShortNowTime()
  8. getStringNowTime()
  9. getStringOfNowDate(String fFormatStr)