Java SQL Date Create getCurrentDate()

Here you can find the source of getCurrentDate()

Description

get Current Date

License

Apache License

Declaration

public static Timestamp getCurrentDate() 

Method Source Code

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

import java.sql.Timestamp;

import java.util.Calendar;

public class Main {
    public static Timestamp getCurrentDate() {

        Calendar c = Calendar.getInstance();
        c.set(c.get(1), c.get(2), c.get(5), 0, 0, 0);
        Timestamp t = new Timestamp(c.getTime().getTime());
        t.setNanos(0);//  ww  w . j  ava 2s  .  co m
        return t;
    }
}

Related

  1. currentDate()
  2. currentDate()
  3. currentDate()
  4. getCurrDate()
  5. getCurrentDate()
  6. getCurrentDate()
  7. getCurrentDate()
  8. getCurrentDate()
  9. getCurrentDate()