org.exparity.hamcrest.date.ZonedDateTimeMatchers Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hamcrest-date Show documentation
Show all versions of hamcrest-date Show documentation
Hamcrest Date matchers for Java
The newest version!
package org.exparity.hamcrest.date;
import static java.time.DayOfWeek.*;
import static java.time.Month.*;
import static org.exparity.hamcrest.date.core.TemporalConverters.*;
import static org.exparity.hamcrest.date.core.TemporalFunctions.ZONEDDATETIME;
import static org.exparity.hamcrest.date.core.TemporalProviders.*;
import java.time.DayOfWeek;
import java.time.LocalDate;
import java.time.Month;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.time.temporal.ChronoField;
import java.time.temporal.ChronoUnit;
import org.exparity.hamcrest.date.core.TemporalMatcher;
import org.exparity.hamcrest.date.core.IsAfter;
import org.exparity.hamcrest.date.core.IsBefore;
import org.exparity.hamcrest.date.core.IsDayOfMonth;
import org.exparity.hamcrest.date.core.IsDayOfWeek;
import org.exparity.hamcrest.date.core.IsFirstDayOfMonth;
import org.exparity.hamcrest.date.core.IsHour;
import org.exparity.hamcrest.date.core.IsLastDayOfMonth;
import org.exparity.hamcrest.date.core.IsLeapYear;
import org.exparity.hamcrest.date.core.IsMaximum;
import org.exparity.hamcrest.date.core.IsMinimum;
import org.exparity.hamcrest.date.core.IsMinute;
import org.exparity.hamcrest.date.core.IsMonth;
import org.exparity.hamcrest.date.core.IsSame;
import org.exparity.hamcrest.date.core.IsSameDay;
import org.exparity.hamcrest.date.core.IsSameOrAfter;
import org.exparity.hamcrest.date.core.IsSameOrBefore;
import org.exparity.hamcrest.date.core.IsSecond;
import org.exparity.hamcrest.date.core.IsWithin;
import org.exparity.hamcrest.date.core.IsYear;
import org.exparity.hamcrest.date.core.types.Interval;
import org.hamcrest.Factory;
/**
* Static factory for creating {@link org.hamcrest.Matcher} instances for comparing {@link ZonedDateTime} instances
*
* @author Stewart Bissett
*/
public abstract class ZonedDateTimeMatchers {
/**
* Creates a matcher that matches when the examined date is after the reference date
*
* For example:
*
*
* MatcherAssert.assertThat(myDate, after(ZonedDateTime.now()));
*
*
* @param date the reference date against which the examined date is checked
*/
public static TemporalMatcher after(final ZonedDateTime date) {
return new IsAfter<>(ZONEDDATETIME_AS_ZONEDDATETIME, zonedDateTime(date), ZONEDDATETIME);
}
/**
* Creates a matcher that matches when the examined date is after the end of the reference year
*
* For example:
*
*
* MatcherAssert.assertThat(myDate, after(2012, Month.MAY, 12));
*
*
* @param year the year against which the examined date is checked
* @param month the month against which the examined date is checked
* @param dayOfMonth the day of the month against which the examined date is checked
* @param hour the hour of the day
* @param minute the minute of the hour
* @param second the second of the minute
* @param nanos the nanos of the second
*/
public static TemporalMatcher after(final int year,
final Month month,
final int dayOfMonth,
final int hour,
final int minute,
final int second,
final int nanos,
final ZoneId tz) {
return after(ZonedDateTime.of(year, month.getValue(), dayOfMonth, hour, minute, second, nanos, tz));
}
/**
* Creates a matcher that matches when the examined date is before the reference date
*
* For example:
*
*
* MatcherAssert.assertThat(myDate, before(ZonedDateTime.now()));
*
*
* @param date the reference date against which the examined date is checked
*/
public static TemporalMatcher before(final ZonedDateTime date) {
return new IsBefore<>(ZONEDDATETIME_AS_ZONEDDATETIME, zonedDateTime(date), ZONEDDATETIME);
}
/**
* Creates a matcher that matches when the examined date is before the end of the reference year
*
* For example:
*
*
* MatcherAssert.assertThat(myDate, before(2012, Month.MAY, 12));
*
*
* @param year the year against which the examined date is checked
* @param month the month against which the examined date is checked
* @param dayOfMonth the day of the month against which the examined date is checked
* @param hour the hour of the day
* @param minute the minute of the hour
* @param second the second of the minute
* @param nanos the nanos of the second
*/
public static TemporalMatcher before(final int year,
final Month month,
final int dayOfMonth,
final int hour,
final int minute,
final int second,
final int nanos,
final ZoneId tz) {
return before(ZonedDateTime.of(year, month.getValue(), dayOfMonth, hour, minute, second, nanos, tz));
}
/**
* Creates a matcher that matches when the examined date is on the same day of the year as the reference date
*
* For example:
*
*
* assertThat(myDate, sameDay(ZonedDateTime.now()));
*
*
* @param date the reference date against which the examined date is checked
*/
public static TemporalMatcher sameDay(final ZonedDateTime date) {
return new IsSameDay<>(ZONEDDATETIME_AS_LOCALDATE, localDate(date));
}
/**
* Creates a matcher that matches when the examined date is on the same day of the year as the reference date
*
* For example:
*
*
* assertThat(myDate, sameDay(LocalDate.now()))
*
*
* @param date the reference date against which the examined date is checked
*/
public static TemporalMatcher isDay(LocalDate date) {
return new IsSameDay<>(ZONEDDATETIME_AS_LOCALDATE, localDate(date));
}
/**
* Creates a matcher that matches when the examined date is on the same day of the year as the reference date
*
* For example:
*
*
* assertThat(myDate, sameDay(2012, Month.JAN, 1))
*
*
* @param dayOfMonth the reference day of the month against which the examined date is checked
* @param month the reference month against which the examined date is checked
* @param year the reference year against which the examined date is checked
*/
public static TemporalMatcher isDay(final int year, final Month month, final int dayOfMonth) {
return isDay(LocalDate.of(year, month, dayOfMonth));
}
/**
* Creates a matcher that matches when the examined date is on the same day of the year as the reference date
*
* For example:
*
*
* assertThat(myDate, sameDay(2012, Month.JAN, 1))
*
*
* @param dayOfMonth the reference day of the month against which the examined date is checked
* @param month the reference month against which the examined date is checked
* @param year the reference year against which the examined date is checked
*/
public static TemporalMatcher isDay(final int year, final Month month, final int dayOfMonth, final ZoneId zone) {
return isDay(LocalDate.of(year, month, dayOfMonth)).atZone(zone);
}
/**
* Creates a matcher that matches when the examined date is at the same instant as the reference date
*
* For example:
*
*
* assertThat(myDate, sameInstant(ZonedDateTime.now()));
*
*
* @param date the reference date against which the examined date is checked
*/
public static TemporalMatcher sameInstant(final ZonedDateTime date) {
return new IsSame<>(ZONEDDATETIME_AS_ZONEDDATETIME, zonedDateTime(date), ZONEDDATETIME);
}
/**
* Creates a matcher that matches when the examined date is at the same specified instance down to the second
*
* For example:
*
*
* assertThat(myDate, sameInstant(2012, Month.JAN, 1, 3, 15, 0))
*
*
* @param dayOfMonth the reference day of the month against which the examined date is checked
* @param month the reference month against which the examined date is checked
* @param year the reference year against which the examined date is checked
* @param hour the hour of the day
* @param minute the minute of the hour
* @param second the second of the minute
* @param nanos the nanosecond of the second
* @param tz the timezone
*/
public static TemporalMatcher isInstant(final int year,
final Month month,
final int dayOfMonth,
final int hour,
final int minute,
final int second,
final int nanos,
final ZoneId tz) {
return sameInstant(ZonedDateTime.of(year, month.getValue(), dayOfMonth, hour, minute, second, nanos, tz));
}
/**
* Creates a matcher that matches when the examined date is at the same instant or before the reference date
*
* For example:
*
*
* assertThat(myDate, sameOrBefore(ZonedDateTime.now()))
*
*
* @param date the reference date against which the examined date is checked
*/
public static TemporalMatcher sameOrBefore(final ZonedDateTime date) {
return new IsSameOrBefore<>(ZONEDDATETIME_AS_ZONEDDATETIME, zonedDateTime(date), ZONEDDATETIME);
}
/**
* Creates a matcher that matches when the examined date is on the same day or before the start of the reference
* date
*
* For example:
*
*
* assertThat(myDate, sameOrBefore(2012, Months.MAY, 12, 11, 59, 59, ZoneId.systemDefault()));
*
*
* @param year the year against which the examined date is checked
* @param month the month against which the examined date is checked
* @param day the day of the month against which the examined date is checked
* @param hour the hour of the day
* @param minute the minute of the hour
* @param second the second of the minute
* @param nanos the nanosecond of the second
* @param tz the time zone of the date to check against
*/
@Factory
public static TemporalMatcher sameOrBefore(final int year,
final Month month,
final int day,
final int hour,
final int minute,
final int second,
final int nanos,
final ZoneId tz) {
return sameOrBefore(ZonedDateTime.of(year, month.getValue(), day, hour, minute, second, nanos, tz));
}
/**
* Creates a matcher that matches when the examined date is at the same instant or after the reference date
*
* For example:
*
*
* assertThat(myDate, sameOrAfter(ZonedDateTime.now()))
*
*
* @param date the reference date against which the examined date is checked
*/
public static TemporalMatcher sameOrAfter(final ZonedDateTime date) {
return new IsSameOrAfter<>(ZONEDDATETIME_AS_ZONEDDATETIME, zonedDateTime(date), ZONEDDATETIME);
}
/**
* Creates a matcher that matches when the examined date is on the same day or before the start of the reference
* date
*
* For example:
*
*
* assertThat(myDate, sameOrAfter(2012, Months.MAY, 12, 11, 59, 59, ZoneId.systemDefault()));
*
*
* @param year the year against which the examined date is checked
* @param month the month against which the examined date is checked
* @param day the day of the month against which the examined date is checked
* @param hour the hour of the day
* @param minute the minute of the hour
* @param second the second of the minute
* @param nanos the nanosecond of the second
* @param tz the time zone of the date to check against
*/
@Factory
public static TemporalMatcher sameOrAfter(final int year,
final Month month,
final int day,
final int hour,
final int minute,
final int second,
final int nanos,
final ZoneId tz) {
return sameOrAfter(ZonedDateTime.of(year, month.getValue(), day, hour, minute, second, nanos, tz));
}
/**
* Creates a matcher that matches when the examined date is on the same month as the reference date
*
* For example:
*
*
* assertThat(myDate, sameMonth(ZonedDateTime.now()))
*
*
* @param date the reference date against which the examined date is checked
*/
public static TemporalMatcher sameMonthOfYear(final ZonedDateTime date) {
return new IsMonth<>(ZONEDDATETIME_AS_MONTH, month(date));
}
/**
* Creates a matcher that matches when the examined date is on the same day of the month as the reference date
*
* For example:
*
*
* assertThat(myDate, sameDayOfMonth(ZonedDateTime.now()))
*
*
* @param date the reference date against which the examined date is checked
*/
public static TemporalMatcher sameDayOfMonth(final ZonedDateTime date) {
return new IsDayOfMonth<>(ZONEDDATETIME_AS_DAYOFMONTH, dayOfMonth(date));
}
/**
* Creates a matcher that matches when the examined date is on the expected day of the month
*
* For example:
*
*
* assertThat(myDate, isDayOfMonth(4))
*
*
* @param dayOfMonth the expected day of the month
*/
public static TemporalMatcher isDayOfMonth(final int dayOfMonth) {
return new IsDayOfMonth<>(ZONEDDATETIME_AS_DAYOFMONTH, dayOfMonth(dayOfMonth));
}
/**
* Creates a matcher that matches when the examined date is on the same year as the reference date
*
* For example:
*
*
* assertThat(myDate, sameYear(ZonedDateTime.now()))
*
*
* @param date the reference date against which the examined date is checked
*/
public static TemporalMatcher sameYear(final ZonedDateTime date) {
return isYear(date.getYear());
}
/**
* Creates a matcher that matches when the examined date is on the same year as the reference year
*
* For example:
*
*
* assertThat(myDate, sameYear(2013))
*
*
* @param year the reference year against which the examined date is checked
*/
public static TemporalMatcher isYear(final int year) {
return new IsYear<>(ZONEDDATETIME_AS_YEAR, year(year));
}
/**
* Creates a matcher that matches when the examined date is within a defined period the reference date
*
* For example:
*
*
* assertThat(myDate, within(10, TimeUnit.DAYS, Moments.today()))
*
*
* @param date the reference date against which the examined date is checked
*/
public static TemporalMatcher within(final long period,
final ChronoUnit unit,
final ZonedDateTime date) {
return new IsWithin<>(Interval.of(period, unit),
ZONEDDATETIME_AS_ZONEDDATETIME,
zonedDateTime(date),
ZONEDDATETIME);
}
/**
* Creates a matcher that matches when the examined date is within a given period of the reference date
*
* For example:
*
*
* assertThat(myDate, within(5, TimeUnit.DAYS, 2012, Months.MAY, 12));
*
*
* @param period the timeunit interval the examined date should be with
* @param unit the timeunit to define the length of the period
* @param year the year against which the examined date is checked
* @param month the month against which the examined date is checked
* @param dayofMonth the day of the month against which the examined date is checked
* @param hour the hour of the day
* @param minute the minute of the hour
* @param second the second of the minute
* @param nanos the nanoseconds of the second
* @param tz the time zone of the reference date
*/
public static TemporalMatcher within(final long period,
final ChronoUnit unit,
final int year,
final Month month,
final int dayofMonth,
final int hour,
final int minute,
final int second,
final int nanos,
final ZoneId tz) {
return within(period,
unit,
ZonedDateTime.of(year, month.getValue(), dayofMonth, hour, minute, second, nanos, tz));
}
/**
* Creates a matcher that matches when the examined date is yesterday
*
* For example:
*
*
* assertThat(myDate, isToday());
*
*/
public static TemporalMatcher isYesterday() {
return sameDay(ZonedDateTime.now().plusDays(-1));
}
/**
* Creates a matcher that matches when the examined date is today
*
* For example:
*
*
* assertThat(myDate, isToday());
*
*/
public static TemporalMatcher isToday() {
return sameDay(ZonedDateTime.now());
}
/**
* Creates a matcher that matches when the examined date is tomorrow
*
* For example:
*
*
* assertThat(myDate, isTomorrow());
*
*/
public static TemporalMatcher isTomorrow() {
return sameDay(ZonedDateTime.now().plusDays(1));
}
/**
* Creates a matcher that matches when the examined date is on the same day of the week as the reference date
*
* For example:
*
*
* assertThat(myDate, sameDayOfWeek(LocalDateTime.now()))
*
*
* @param date the reference date against which the examined date is checked
*/
public static TemporalMatcher sameDayOfWeek(final ZonedDateTime date) {
return isDayOfWeek(DayOfWeek.from(date));
}
/**
* Creates a matcher that matches when the examined date is on the same day of the week as the supplied day
*
* For example:
*
*
* assertThat(myDate, isMonday());
*
*/
public static TemporalMatcher isDayOfWeek(final DayOfWeek dayOfWeek) {
return new IsDayOfWeek<>(ZONEDDATETIME_AS_DAYOFWEEK, daysOfWeek(dayOfWeek));
}
/**
* Creates a matcher that matches when the examined date is on the same day of the week as any of the supplied days
*
* For example:
*
*
* assertThat(myDate, isMonday());
*
*/
public static TemporalMatcher isDayOfWeek(final DayOfWeek... daysOfWeek) {
return new IsDayOfWeek<>(ZONEDDATETIME_AS_DAYOFWEEK, daysOfWeek(daysOfWeek));
}
/**
* Creates a matcher that matches when the examined date is on a monday
*
* For example:
*
*
* assertThat(myDate, isMonday());
*
*/
public static TemporalMatcher isMonday() {
return isDayOfWeek(MONDAY);
}
/**
* Creates a matcher that matches when the examined date is on a tuesday
*
* For example:
*
*
* assertThat(myDate, isTuesday());
*
*/
public static TemporalMatcher isTuesday() {
return isDayOfWeek(TUESDAY);
}
/**
* Creates a matcher that matches when the examined date is on a wednesday
*
* For example:
*
*
* assertThat(myDate, isWednesday());
*
*/
public static TemporalMatcher isWednesday() {
return isDayOfWeek(WEDNESDAY);
}
/**
* Creates a matcher that matches when the examined date is on a thursday
*
* For example:
*
*
* assertThat(myDate, isThursday());
*
*/
public static TemporalMatcher isThursday() {
return isDayOfWeek(THURSDAY);
}
/**
* Creates a matcher that matches when the examined date is on a friday
*
* For example:
*
*
* assertThat(myDate, isFriday());
*
*/
public static TemporalMatcher isFriday() {
return isDayOfWeek(FRIDAY);
}
/**
* Creates a matcher that matches when the examined date is on a saturday
*
* For example:
*
*
* assertThat(myDate, isSaturday());
*
*/
public static TemporalMatcher isSaturday() {
return isDayOfWeek(SATURDAY);
}
/**
* Creates a matcher that matches when the examined date is on a sunday
*
* For example:
*
*
* assertThat(myDate, isSunday());
*
*/
public static TemporalMatcher isSunday() {
return isDayOfWeek(SUNDAY);
}
/**
* Creates a matcher that matches when the examined date is on a weekday
*
* For example:
*
*
* assertThat(myDate, isWeekday());
*
*/
public static TemporalMatcher isWeekday() {
return isDayOfWeek(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY);
}
/**
* Creates a matcher that matches when the examined date is on a weekend
*
* For example:
*
*
* assertThat(myDate, isWeekend());
*
*/
public static TemporalMatcher isWeekend() {
return isDayOfWeek(SATURDAY, SUNDAY);
}
/**
* Creates a matcher that matches when the examined date is on the first day of the month
*
* For example:
*
*
* assertThat(myDate, isFirstDayOfMonth());
*
*/
public static TemporalMatcher isFirstDayOfMonth() {
return new IsFirstDayOfMonth<>(ZONEDDATETIME_AS_ZONEDDATETIME);
}
/**
* Creates a matcher that matches when the examined date is on the maximum value of the given date part in its
* period
*
* For example:
*
*
* assertThat(myDate, isMaximumDayOfMonth(ChronoField.DAY_OF_MONTH));
*
*
* @param field the temporal field to check
*/
public static TemporalMatcher isMinimum(final ChronoField field) {
return new IsMinimum<>(ZONEDDATETIME_AS_ZONEDDATETIME, field);
}
/**
* Creates a matcher that matches when the examined date is on the first day of the month
*
* For example:
*
*
* assertThat(myDate, isFirstDayOfMonth());
*
*/
public static TemporalMatcher isLastDayOfMonth() {
return new IsLastDayOfMonth<>(ZONEDDATETIME_AS_ZONEDDATETIME);
}
/**
* Creates a matcher that matches when the examined date is on the maximum value of the given date part in its
* period
*
* For example:
*
*
* assertThat(myDate, isMaximum(ChronoField.DAY_OF_MONTH));
*
*
* @param field the temporal field to check
*/
public static TemporalMatcher isMaximum(final ChronoField field) {
return new IsMaximum<>(ZONEDDATETIME_AS_ZONEDDATETIME, field);
}
/**
* Creates a matcher that matches when the examined date is in the expected month
*
* For example:
*
*
* assertThat(myDate, isMonth(Month.AUGUST));
*
*/
public static TemporalMatcher isMonth(final Month month) {
return new IsMonth<>(ZONEDDATETIME_AS_MONTH, month(month));
}
/**
* Creates a matcher that matches when the examined date is in January
*
* For example:
*
*
* assertThat(myDate, isJanuary());
*
*/
public static TemporalMatcher isJanuary() {
return isMonth(JANUARY);
}
/**
* Creates a matcher that matches when the examined date is in February
*
* For example:
*
*
* assertThat(myDate, isFebruary());
*
*/
public static TemporalMatcher isFebruary() {
return isMonth(FEBRUARY);
}
/**
* Creates a matcher that matches when the examined date is in March
*
* For example:
*
*
* assertThat(myDate, isMarch());
*
*/
public static TemporalMatcher isMarch() {
return isMonth(MARCH);
}
/**
* Creates a matcher that matches when the examined date is in April
*
* For example:
*
*
* assertThat(myDate, isApril());
*
*/
public static TemporalMatcher isApril() {
return isMonth(APRIL);
}
/**
* Creates a matcher that matches when the examined date is in May
*
* For example:
*
*
* assertThat(myDate, isMay());
*
*/
public static TemporalMatcher isMay() {
return isMonth(MAY);
}
/**
* Creates a matcher that matches when the examined date is in June
*
* For example:
*
*
* assertThat(myDate, isJune());
*
*/
public static TemporalMatcher isJune() {
return isMonth(JUNE);
}
/**
* Creates a matcher that matches when the examined date is in July
*
* For example:
*
*
* assertThat(myDate, isJuly());
*
*/
public static TemporalMatcher isJuly() {
return isMonth(JULY);
}
/**
* Creates a matcher that matches when the examined date is in August
*
* For example:
*
*
* assertThat(myDate, isAugust());
*
*/
public static TemporalMatcher isAugust() {
return isMonth(AUGUST);
}
/**
* Creates a matcher that matches when the examined date is in September
*
* For example:
*
*
* assertThat(myDate, isSeptember());
*
*/
public static TemporalMatcher isSeptember() {
return isMonth(SEPTEMBER);
}
/**
* Creates a matcher that matches when the examined date is in October
*
* For example:
*
*
* assertThat(myDate, isOctober());
*
*/
public static TemporalMatcher isOctober() {
return isMonth(OCTOBER);
}
/**
* Creates a matcher that matches when the examined date is in November
*
* For example:
*
*
* assertThat(myDate, isNovember());
*
*/
public static TemporalMatcher isNovember() {
return isMonth(NOVEMBER);
}
/**
* Creates a matcher that matches when the examined date is in December
*
* For example:
*
*
* assertThat(myDate, isDecember());
*
*/
public static TemporalMatcher isDecember() {
return isMonth(DECEMBER);
}
/**
* Creates a matcher that matches when the examined date is a leap year
*
* For example:
*
*
* assertThat(myDate, isLeapYear());
*
*/
public static TemporalMatcher isLeapYear() {
return new IsLeapYear<>(ZONEDDATETIME_AS_YEAR);
}
/**
* Creates a matcher that matches when the examined date is on the expected hour (0-23)
*
* For example:
*
*
* assertThat(myDate, isHour(12));
*
*
* @param hour the hour of the day (0-23)
*/
public static TemporalMatcher isHour(final int hour) {
return new IsHour<>(ZONEDDATETIME_AS_HOUR, hour(hour));
}
/**
* Creates a matcher that matches when the examined date is on the same hour as the reference date
*
* For example:
*
*
* assertThat(myDate, sameHourOfDay(ZonedDateTime.now()))
*
*
* @param date the reference date against which the examined date is checked
*/
public static TemporalMatcher sameHourOfDay(final ZonedDateTime date) {
return new IsHour<>(ZONEDDATETIME_AS_HOUR, hour(date));
}
/**
* Creates a matcher that matches when the examined date is on the expected minute (0-59)
*
* For example:
*
*
* assertThat(myDate, isMinute(12));
*
*
* @param minute the minute of the day (0-59)
*/
public static TemporalMatcher isMinute(final int minute) {
return new IsMinute<>(ZONEDDATETIME_AS_MINUTE, minute(minute));
}
/**
* Creates a matcher that matches when the examined date is on the same minute as the reference date
*
* For example:
*
*
* assertThat(myDate, sameMinuteOfHour(ZonedDateTime.now()))
*
*
* @param date the reference date against which the examined date is checked
*/
public static TemporalMatcher sameMinuteOfHour(final ZonedDateTime date) {
return new IsMinute<>(ZONEDDATETIME_AS_MINUTE, minute(date));
}
/**
* Creates a matcher that matches when the examined date is on the expected second (0-59)
*
* For example:
*
*
* assertThat(myDate, isSecond(12));
*
*
* @param second the second of the day (0-59)
*/
public static TemporalMatcher isSecond(final int second) {
return new IsSecond<>(ZONEDDATETIME_AS_SECOND, second(second));
}
/**
* Creates a matcher that matches when the examined date is on the same second as the reference date
*
* For example:
*
*
* assertThat(myDate, sameSecondOfMinute(ZonedDateTime.now()))
*
*
* @param date the reference date against which the examined date is checked
*/
public static TemporalMatcher sameSecondOfMinute(final ZonedDateTime date) {
return new IsSecond<>(ZONEDDATETIME_AS_SECOND, second(date));
}
}