怎么判断两个datefield的大小。
也就是哪个先哪个后?
也就是哪个先哪个后?
解决方案 »
- 类字面值是什么意思
- 怎样才能把软件开发学好?
- 一个"hello world"程序的问题!1
- 关于全半角的转换
- [原创]服务器上的一个文本方式的配置文件,服务器上的java applet程序要访问它,得到配置文件中的信息,然后放在tomcat下供客户端浏览。
- 如何清空jtable? 谢谢
- java面试要注意什么呢?
- 请问各位高手,为什么我打包完后,只是得到一个Test.rar的压缩文件,而我想要的*.exe(双击即可)的文件却得不到?
- 谁有sqlServer的第三方的jdbc驱动程序
- JAVA 用stati 在多人同时调用时结果会不会乱?
- rt.jar ,dt.jar ,tool.jar都包含什么 ,分别什么时候需要设置到classpath里?
- 急,在线等!关于文件下载,打开为空
如果两个日期/时间相等,返回0,如果当前日期更先,反回值小于0,剩下那种情况返回值大于0
谢谢 jamesfancy(▲) 边城狂人 的回答,不过j2se好像没有compareTo的方法。问题我已经解决.
datefiled.getDate().getTime() 可以用这个解决
public int compareTo(Date anotherDate)Compares two Dates for ordering. Specified by:
compareTo in interface Comparable<Date>
Parameters:
anotherDate - the Date to be compared.
Returns:
the value 0 if the argument Date is equal to this Date; a value less than 0 if this Date is before the Date argument; and a value greater than 0 if this Date is after the Date argument.
Throws:
NullPointerException - if anotherDate is null.
Since:
1.2