Java TimeZone Get getTimeInCurrentDay(long now, TimeZone tz, int hour, int minute, int second, int millisecond)

Here you can find the source of getTimeInCurrentDay(long now, TimeZone tz, int hour, int minute, int second, int millisecond)

Description

get Time In Current Day

License

Open Source License

Declaration

static public java.util.Calendar getTimeInCurrentDay(long now, TimeZone tz, int hour, int minute, int second,
            int millisecond) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2014 Whizzo Software, LLC.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *******************************************************************************/

import java.util.TimeZone;

public class Main {
    static public java.util.Calendar getTimeInCurrentDay(long now, TimeZone tz, int hour, int minute, int second,
            int millisecond) {
        java.util.Calendar cal = java.util.Calendar.getInstance(tz);
        cal.setTimeInMillis(now);//from  ww w  .  ja va 2  s.c o m
        cal.set(java.util.Calendar.HOUR_OF_DAY, hour);
        cal.set(java.util.Calendar.MINUTE, minute);
        cal.set(java.util.Calendar.SECOND, second);
        cal.set(java.util.Calendar.MILLISECOND, millisecond);
        return cal;
    }
}

Related

  1. getTime(boolean lenient, TimeZone tz, int year, int month, int day, int hour, int minute, int second, boolean setMillis, int nano)
  2. getTime(final String time, final TimeZone tz)
  3. getTime(TimeZone tz, int year, int month, int day, int hour, int minute, int second)
  4. getTime(TimeZone zone)
  5. getTimeAsPerTimeZone(String time, String timeZOne)
  6. getTimeTry(boolean lenient, TimeZone tz, int year, int month, int day, int hour, int minute, int second, int millis)
  7. getTimeWithTimeZone(final String timezoneId)
  8. getTimeZone(Calendar cal)
  9. getTimeZone(final String ID)