Here you can find the source of getDayOfDate(Date date)
Description:Get Monday of the week the day specified by parameter belongs to
Parameter | Description |
---|---|
Date | date any date |
public static int getDayOfDate(Date date)
//package com.java2s; /*/*from w w w .ja v a 2s. c o m*/ * $RCSfile: DatetimeUtil,v $$ * $Revision: 1.0 $ * $Date: 2011 $ * * Copyright (C) 2011 GyTech, Inc. All rights reserved. * * This software is the proprietary information of GyTech, Inc. * Use is subject to license terms. */ import java.util.Calendar; import java.util.Date; public class Main { /** *<p>Description:Get Monday of the week the day specified by parameter belongs to</p> * @param Date date any date * @return boolean */ public static int getDayOfDate(Date date) { Calendar calendar = Calendar.getInstance(); calendar.setTime(date); return calendar.get(Calendar.DAY_OF_WEEK) - Calendar.SUNDAY; } }