Here you can find the source of parseDay(Date value, String defaultValue)
Parameter | Description |
---|---|
value | the date value to parse |
defaultValue | the default value returned |
public static String parseDay(Date value, String defaultValue)
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; public class Main { /**/*from w w w . ja v a 2 s . c om*/ * Parses the day field from the given date. * * @param value the date value to parse * @param defaultValue the default value returned * @return the day value, or the default for null dates */ public static String parseDay(Date value, String defaultValue) { if (value == null) { return defaultValue; } return new SimpleDateFormat("d").format(value); } }