Java TimeUnit Usage todayStart()

Here you can find the source of todayStart()

Description

today Start

License

Apache License

Declaration

public static long todayStart() 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.Calendar;

import java.util.concurrent.TimeUnit;

public class Main {
    public static final long SECOND = TimeUnit.SECONDS.toMillis(1);
    public static final long MINUTE = TimeUnit.MINUTES.toMillis(1);

    public static long todayStart() {
        final Calendar calendar = Calendar.getInstance();
        calendar.set(Calendar.HOUR_OF_DAY, 0);
        calendar.set(Calendar.MINUTE, 0);
        calendar.set(Calendar.SECOND, 0);
        calendar.set(Calendar.MILLISECOND, 0);
        return calendar.getTimeInMillis();
    }/*from w ww .jav  a  2  s .co m*/
}

Related

  1. timeToHMS(final long time)
  2. TimeToString(int ticks)
  3. toBias(long offset)
  4. todayInMillis()
  5. toDays(Date date)
  6. toHeaderValue(long timeoutNanos)
  7. toMsTime(final String value)
  8. toString(final Stopwatch watch)
  9. toString(long milliseconds)