使用SimpleDateFormat格式化日期
2014-03-26 11:30
525 查看
import java.text.SimpleDateFormat; import java.util.Date; public class SimpleDateFormatDemo { public static void main(String[] args) { SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); System.out.println(sdf.format(new Date())); } }
控制台输出:
相关文章推荐
- 使用SimpleDateFormat格式化日期
- java 日期格式化-- SimpleDateFormat 的使用。字符串转日期,日期转字符串
- Java 使用SimpleDateFormat格式化日期
- 使用SimpleDateFormat格式化日期
- 使用 SimpleDateFormat 类格式化日期
- java 使用simpleDateFormat格式化日期 时间
- 使用 SimpleDateFormat 格式化日期和使用printf格式化日期
- java 日期格式化-- SimpleDateFormat 的使用。字符串转日期,日期转字符串
- java 使用simpleDateFormat格式化日期 时间
- 《黑马程序员》 日期Data类,日期格式化DateFormat,自定义格式化SimpleDateFormat的使用
- java 使用simpleDateFormat格式化日期 时间
- Java日期格式化及其使用例子收集 SimpleDateFormat担当重任,怎样格式化都行
- SimpleDateFormat日期格式化
- Java格式化日期类DateFormat和SimpleDateFormat的学习
- xslt格式化日期和时间:使用ms:format-date、ms:format-time
- Java中SimpleDateFormat格式化日期用法
- SimpleDateFormat格式化日期
- Java进阶(二十八)SimpleDateFormat格式化日期问题
- SimpleDateFormat日期格式化
- SimpleDateFormat格式化日期时间格式