Java Timestamp Create getTimestamp(int year, int month, int day, int hour, int min, int second)

Here you can find the source of getTimestamp(int year, int month, int day, int hour, int min, int second)

Description

get Timestamp

License

Open Source License

Declaration

public static Timestamp getTimestamp(int year, int month, int day,
            int hour, int min, int second) 

Method Source Code

//package com.java2s;

import java.sql.Timestamp;

import java.util.Calendar;

public class Main {
    public static Timestamp getTimestamp(int year, int month, int day,
            int hour, int min, int second) {
        Calendar calendar = Calendar.getInstance();
        calendar.set(year, month - 1, day, hour, min, second);
        return new Timestamp(calendar.getTimeInMillis());
    }/*from   w  w  w .  j  a  v a 2  s  .  c  o  m*/
}

Related

  1. getTimestamp(Date time)
  2. getTimestamp(final File file)
  3. getTimestamp(final LocalDate date)
  4. getTimestamp(final Map map, final Object key)
  5. getTimestamp(int offset)
  6. getTimestamp(java.util.Date utilDate)
  7. getTimestamp(long time)
  8. getTimestamp(Object o)
  9. getTimestamp(Object value)