Java SQL Date todaySQL()

Here you can find the source of todaySQL()

Description

a date set at midnight

License

Apache License

Declaration

public static java.sql.Date todaySQL() 

Method Source Code

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

import java.util.*;

public class Main {
    /**// w ww  .  j a  v  a 2 s  .  com
       * a date set at midnight
       * @return
       */
    public static java.sql.Date todaySQL() {
        return new java.sql.Date(today().getTime());
    }

    /**
       * today's date
      * with time set at midnight
       * @return
       */
    public static Date today() {
        Calendar calNow = Calendar.getInstance();
        calNow.set(Calendar.HOUR, 0);
        calNow.set(Calendar.MINUTE, 0);
        calNow.set(Calendar.SECOND, 0);
        calNow.set(Calendar.MILLISECOND, 0);
        return calNow.getTime();
    }
}

Related

  1. stringToMillis(String str)
  2. toAge(String birthDay)
  3. today()
  4. today()
  5. today()