Java SQL Time Create getThisWeekStartTime()

Here you can find the source of getThisWeekStartTime()

Description

get This Week Start Time

License

Open Source License

Declaration

public static Date getThisWeekStartTime() 

Method Source Code


//package com.java2s;
import java.sql.Timestamp;

import java.util.Calendar;
import java.util.Date;

public class Main {
    public static Date getThisWeekStartTime() {
        Calendar today = Calendar.getInstance();
        today.set(Calendar.DAY_OF_WEEK, today.getFirstDayOfWeek());
        Calendar weekFirstDay = Calendar.getInstance();
        weekFirstDay.clear();// w  w  w .  j a  va  2  s.  c o m
        weekFirstDay.set(Calendar.YEAR, today.get(Calendar.YEAR));
        weekFirstDay.set(Calendar.MONTH, today.get(Calendar.MONTH));
        weekFirstDay.set(Calendar.DATE, today.get(Calendar.DATE));
        return weekFirstDay.getTime();
    }

    public static Timestamp getTime() {
        return new Timestamp(new Date().getTime());
    }
}

Related

  1. getSqlTimeFromTimeNumber(int time)
  2. getSysDateTimeMillis()
  3. getSystemCurrentTimeMillis()
  4. getSystemTimeGMTToday()
  5. getSysTime()
  6. getTime()
  7. getTime()
  8. getTime(final int hour, final int minute, final int second)
  9. getTime(GregorianCalendar cal)