---
# System prepended metadata

title: Date 轉換
tags: [實作相關]

---

Date 轉換
===

取得年月日，EX：
```
Date date = new Date();
date.getYear()
```

舊方式將被棄用
請參考新的取得[方式](https://stackoverflow.com/a/6186006)

## Ref.
[[Java] Date SimpleDateFormat Calendar之轉換與時區(UTC/GMT)問題](https://cdfq152313.github.io/post/2017-04-27/)

Date 格式代號:
[DateFormat 和 SimpleDateFormat](http://androidbiancheng.blogspot.com/2010/09/dateformat-simpledateformat.html)

[Convert Date String to UTC format [duplicate]](https://stackoverflow.com/questions/52821700/convert-date-string-to-utc-format)

[Converting a Date object to a calendar object [duplicate]](https://stackoverflow.com/a/6186006)
###### tags: `實作相關`