how to convert timestamp string to java.util.Date

后端 未结 3 1923
星月不相逢
星月不相逢 2021-01-07 22:16

I need to convert a timestamp string to java.util.Date. E.g.:

MMDDYYHHMMSS to MM-DD-YY HH-MM-SS

Where MM

3条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-07 23:00

    use a SimpleDateFormat with an appropriate format string (be careful to use the correct format letters, uppercase and lowercase have different meanings!).

提交回复
热议问题