Parse yyyy/mm/dd to epoch timestamp using SimpleDateFormat in java

后端 未结 2 2051
南旧
南旧 2020-12-21 19:00

I wrote a java utility function to convert yyyy/mm/dd as follows

public static long gettimestamp(String dateString) {
  SimpleDateFormat df = new SimpleDateF         


        
2条回答
  •  被撕碎了的回忆
    2020-12-21 19:48

    You should uppercase the M. Lowercase m stands for minutes, while uppercase stands for month. Here's the documentation.

提交回复
热议问题