本文整理了Java中com.datastax.driver.core.LocalDate.<init>()
方法的一些代码示例,展示了LocalDate.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。LocalDate.<init>()
方法的具体详情如下:
包路径:com.datastax.driver.core.LocalDate
类名称:LocalDate
方法名:<init>
暂无
代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core
/**
* Builds a new instance from a number of days since January 1st, 1970 GMT.
*
* @param daysSinceEpoch the number of days.
* @return the new instance.
*/
public static LocalDate fromDaysSinceEpoch(int daysSinceEpoch) {
return new LocalDate(daysSinceEpoch);
}
代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core
/**
* Builds a new instance from a number of milliseconds since January 1st, 1970 GMT. Note that if
* the given number does not correspond to a whole number of days, it will be rounded towards 0.
*
* @param millisSinceEpoch the number of milliseconds since January 1st, 1970 GMT.
* @return the new instance.
* @throws IllegalArgumentException if the date is not in the range [-5877641-06-23;
* 5881580-07-11].
*/
public static LocalDate fromMillisSinceEpoch(long millisSinceEpoch)
throws IllegalArgumentException {
long daysSinceEpoch = TimeUnit.MILLISECONDS.toDays(millisSinceEpoch);
checkArgument(
daysSinceEpoch >= Integer.MIN_VALUE && daysSinceEpoch <= Integer.MAX_VALUE,
"Date should be in the range [-5877641-06-23; 5881580-07-11]");
return new LocalDate((int) daysSinceEpoch);
}
代码示例来源:origin: io.prestosql.cassandra/cassandra-driver
/**
* Builds a new instance from a number of days since January 1st, 1970 GMT.
*
* @param daysSinceEpoch the number of days.
* @return the new instance.
*/
public static LocalDate fromDaysSinceEpoch(int daysSinceEpoch) {
return new LocalDate(daysSinceEpoch);
}
代码示例来源:origin: com.yugabyte/cassandra-driver-core
/**
* Builds a new instance from a number of days since January 1st, 1970 GMT.
*
* @param daysSinceEpoch the number of days.
* @return the new instance.
*/
public static LocalDate fromDaysSinceEpoch(int daysSinceEpoch) {
return new LocalDate(daysSinceEpoch);
}
代码示例来源:origin: com.facebook.presto.cassandra/cassandra-driver
/**
* Builds a new instance from a number of days since January 1st, 1970 GMT.
*
* @param daysSinceEpoch the number of days.
* @return the new instance.
*/
public static LocalDate fromDaysSinceEpoch(int daysSinceEpoch) {
return new LocalDate(daysSinceEpoch);
}
代码示例来源:origin: com.yugabyte/cassandra-driver-core
/**
* Builds a new instance from a number of milliseconds since January 1st, 1970 GMT.
* Note that if the given number does not correspond to a whole number of days,
* it will be rounded towards 0.
*
* @param millisSinceEpoch the number of milliseconds since January 1st, 1970 GMT.
* @return the new instance.
* @throws IllegalArgumentException if the date is not in the range [-5877641-06-23; 5881580-07-11].
*/
public static LocalDate fromMillisSinceEpoch(long millisSinceEpoch) throws IllegalArgumentException {
long daysSinceEpoch = TimeUnit.MILLISECONDS.toDays(millisSinceEpoch);
checkArgument(daysSinceEpoch >= Integer.MIN_VALUE && daysSinceEpoch <= Integer.MAX_VALUE,
"Date should be in the range [-5877641-06-23; 5881580-07-11]");
return new LocalDate((int) daysSinceEpoch);
}
代码示例来源:origin: com.facebook.presto.cassandra/cassandra-driver
/**
* Builds a new instance from a number of milliseconds since January 1st, 1970 GMT.
* Note that if the given number does not correspond to a whole number of days,
* it will be rounded towards 0.
*
* @param millisSinceEpoch the number of milliseconds since January 1st, 1970 GMT.
* @return the new instance.
* @throws IllegalArgumentException if the date is not in the range [-5877641-06-23; 5881580-07-11].
*/
public static LocalDate fromMillisSinceEpoch(long millisSinceEpoch) throws IllegalArgumentException {
long daysSinceEpoch = TimeUnit.MILLISECONDS.toDays(millisSinceEpoch);
checkArgument(daysSinceEpoch >= Integer.MIN_VALUE && daysSinceEpoch <= Integer.MAX_VALUE,
"Date should be in the range [-5877641-06-23; 5881580-07-11]");
return new LocalDate((int) daysSinceEpoch);
}
代码示例来源:origin: io.prestosql.cassandra/cassandra-driver
/**
* Builds a new instance from a number of milliseconds since January 1st, 1970 GMT.
* Note that if the given number does not correspond to a whole number of days,
* it will be rounded towards 0.
*
* @param millisSinceEpoch the number of milliseconds since January 1st, 1970 GMT.
* @return the new instance.
* @throws IllegalArgumentException if the date is not in the range [-5877641-06-23; 5881580-07-11].
*/
public static LocalDate fromMillisSinceEpoch(long millisSinceEpoch) throws IllegalArgumentException {
long daysSinceEpoch = TimeUnit.MILLISECONDS.toDays(millisSinceEpoch);
checkArgument(daysSinceEpoch >= Integer.MIN_VALUE && daysSinceEpoch <= Integer.MAX_VALUE,
"Date should be in the range [-5877641-06-23; 5881580-07-11]");
return new LocalDate((int) daysSinceEpoch);
}
内容来源于网络,如有侵权,请联系作者删除!