Java Calendar Calculate alignSecond(Calendar timestamp)

Here you can find the source of alignSecond(Calendar timestamp)

Description

Aligns the time fields to the start of the second.

License

Apache License

Parameter

Parameter Description
timestamp The calendar to align.

Return

The parameter.

Declaration

public static Calendar alignSecond(Calendar timestamp) 

Method Source Code

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

import java.util.*;

public class Main {
    /**//from   ww w .  j a  v a  2 s  .  c  o m
     * Aligns the time fields to the start of the second.
     * @param timestamp The calendar to align.
     * @return The parameter.
     */
    public static Calendar alignSecond(Calendar timestamp) {
        timestamp.set(Calendar.MILLISECOND, 0);
        return timestamp;
    }
}

Related

  1. addQuarter(Calendar calendar, int quarterDelta)
  2. addTime(int calendarType, long time, int number)
  3. alignHours(int interval, Calendar timestamp)
  4. cal2Str(Calendar pCal)
  5. calcAge(Calendar dateOfBirth, Calendar now)
  6. calcDifferenceAsDays(Calendar aBaseDate, Calendar aTargetDate)
  7. calcDifferenceAsYearsPrivate(Calendar aBaseDate, Calendar aTargetDate)