Java Month of Year createTimestamp(int year, int month, int day, int hour, int minutes, int seconds)

Here you can find the source of createTimestamp(int year, int month, int day, int hour, int minutes, int seconds)

Description

create Timestamp

License

Open Source License

Declaration

public static long createTimestamp(int year, int month, int day, int hour, int minutes, int seconds) 

Method Source Code

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

import java.util.Calendar;

public class Main {
    public static long createTimestamp(int year, int month, int day, int hour, int minutes, int seconds) {
        Calendar calendar = Calendar.getInstance();
        calendar.clear();//from  ww  w .  ja  v  a  2 s  .c  o  m
        calendar.set(Calendar.YEAR, year);
        calendar.set(Calendar.MONTH, month - 1);
        calendar.set(Calendar.DAY_OF_MONTH, day);
        calendar.set(Calendar.HOUR_OF_DAY, hour);
        calendar.set(Calendar.MINUTE, minutes);
        calendar.set(Calendar.SECOND, seconds);
        return calendar.getTimeInMillis();
    }
}

Related

  1. create(final int year, final int month, final int day)
  2. create(int year, int month, int day)
  3. create(int year, int month, int day, int hour, int minute, int second)
  4. createKey(int instance, int year, int month, int day, int hour, int min, int sec, int milli, String uuid, boolean rolling)
  5. currentYearMonth()
  6. dayOfYear(int year, int month, int day)
  7. dayOfYear(int year, int month, int day)
  8. daysInMonth(final int month, final int year)