您如何计算从 Java 中的 SQL 获取的两个时间戳之间的年/月/天(实际上不需要时间)?
下面是我正在使用的代码片段:
query = "SELECT bc.periodbeginningdate " +
"FROM cus_billingcontract bc " +
"WHERE cus_billingcontract_id = " + recordID;
Timestamp bDate = DB.getSQLValueTS(null, query);
query = "SELECT bc.periodenddate " +
"FROM cus_billingcontract bc " +
"WHERE cus_billingcontract_id = " + recordID;
Timestamp eDate = DB.getSQLValueTS(null, query);