Java Timestamp from getFirstTimeOfDay(Calendar calendar)

Here you can find the source of getFirstTimeOfDay(Calendar calendar)

Description

get First Time Of Day

License

Open Source License

Declaration

public static Timestamp getFirstTimeOfDay(Calendar calendar) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.sql.Timestamp;

import java.util.Calendar;

public class Main {

    public static Timestamp getFirstTimeOfDay(Calendar calendar) {

        calendar.set(Calendar.HOUR_OF_DAY, 0);
        calendar.set(Calendar.MINUTE, 0);
        calendar.set(Calendar.SECOND, 0);

        return new Timestamp(calendar.getTimeInMillis());
    }//from w ww. j a va 2s .c o m
}

Related

  1. convertToTimestamp(String dateString, String pattern)
  2. convertToTimestamp(String s)
  3. convertToTimeStamp(Timestamp timestamp, String format, TimeZone timeZone)
  4. convertToTimestampDate(Date date)
  5. convertToTimestampHMS(String dateData)
  6. timestampFromCalendar(Calendar calendar)
  7. timestampFromLong(long t)
  8. timestampFromYearMonthDateHourMinuteSecondNanos( int year, int month, int date, int hour, int minute, int second, int nanos)