---
title: "simpledateformat格式的错误认识"
author: "showtime520"
date: "2008-12-31T18:53:27Z"
tags: []
slug: "simpledateformat"
draft: false
lastmod: "2008-12-31T18:53:27Z"
id: 308519
url: "https://showtime520.iteye.com/blog/308519"
---

```java

//这样写小时是24小时制
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//12小时制
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");

```


转换格式是区分大小写的