有一段时间。从当前时间创建的时间值,有没有快速的方法将其“nsec”字段设置为零?在我的情况下,这部分对于映射到mysql中的第二级日期时间字段没有用。
答案 0 :(得分:2)
将time.Truncate
与import javax.ws.rs.GET;
import javax.ws.rs.Produces;
import javax.ws.rs.Path;
@Path("/SericeCreation")
public class SericeCreation {
@GET
@Produces("text/plain")
public String display(){
return "hello";
}
}
:
Truncate将舍入t的结果返回到d的倍数(从零时间开始)。如果d <= 0,则Truncate返回t不变。