Java Long Number to Date dateToPGNDate(long when)

Here you can find the source of dateToPGNDate(long when)

Description

get PGN format of the date (the version in chesspresso.pgn.PGN gets the month wrong :( )

License

Open Source License

Parameter

Parameter Description
when date to convert

Return

PGN format of the date

Declaration

public static String dateToPGNDate(long when) 

Method Source Code


//package com.java2s;
//License from project: GNU General Public License 

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    /**/*from   w w  w .  ja  v a 2  s .c  om*/
     * get PGN format of the date (the version in chesspresso.pgn.PGN gets the
     * month wrong :( )
     *
     * @param when date to convert
     * @return PGN format of the date
     */
    public static String dateToPGNDate(long when) {
        return new SimpleDateFormat("yyyy.MM.dd").format(new Date(when));
    }
}

Related

  1. convertMsToDate(long millis)
  2. convertMsToSimpleDate(long Millis)
  3. convertUNIXTimeToString(long time)
  4. dateToAPODString(long date)
  5. dateToLong(String date)
  6. dateToString(long date)
  7. dateToString(long date)
  8. dateToString(long date)
  9. dateToString(long date)