Java Year Month getYearMonthDate()

Here you can find the source of getYearMonthDate()

Description

get Year Month Date

License

Open Source License

Declaration

public static String getYearMonthDate() 

Method Source Code


//package com.java2s;
/*//w  w w  .  j av  a 2  s  . c o m
 * K4M, License, Version 1.1
 *
 * Copyright (c) 2000 K4M.  All rights  reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are prohibited.
 */

import java.text.SimpleDateFormat;
import java.util.Date;

public class Main {

    public static String getYearMonthDate() {
        return new SimpleDateFormat("yyyyMMdd").format(new Date());
    }

    public static String getYearMonthDate(long date) {
        return new SimpleDateFormat("yyyyMMdd").format(new Date(date));
    }
}

Related

  1. getYearMonth(Calendar sDate)
  2. getYearMonth(Date date)
  3. getYearMonth(Date date)
  4. getYearMonth(String dateString)
  5. getYearMonth(String year)
  6. getYearMonthDateByMisSecond(long misSecond)
  7. getYearMonthDay()
  8. getYearMonthDay(Date date)
  9. getYearMonthDay(final int year, final int month, final int day)