/** * Create an expression representing the current time instant as a DateTimeExpression instance * * @return current timestamp */ public static DateTimeExpression<Date> currentTimestamp() { return DateTimeExpression.currentTimestamp(); }
/** * Create an expression representing the current time instant as a DateTimeExpression instance * * @return current timestamp */ public static DateTimeExpression<Date> currentTimestamp() { return DateTimeExpression.currentTimestamp(); }
@Test public void currentTimestamp() { assertToString("current_timestamp", DateTimeExpression.currentTimestamp()); }
@Test public void dateTime_to_date() { firstResult(SQLExpressions.date(DateTimeExpression.currentTimestamp())); }
@Test @ExcludeIn({SQLITE}) // FIXME public void date_trunc() { DateTimeExpression<java.util.Date> expr = DateTimeExpression.currentTimestamp(); List<DatePart> dps = Lists.newArrayList(); add(dps, DatePart.year); add(dps, DatePart.month); add(dps, DatePart.week, DERBY, FIREBIRD, SQLSERVER); add(dps, DatePart.day); add(dps, DatePart.hour); add(dps, DatePart.minute); add(dps, DatePart.second); for (DatePart dp : dps) { firstResult(SQLExpressions.datetrunc(dp, expr)); } }
@Test DateTimeExpression<DateTime> expr = DateTimeExpression.currentTimestamp(DateTime.class);