Groovy String to Date

后端 未结 7 1970
花落未央
花落未央 2020-12-02 11:45

I am coding this with Groovy

I am currently trying to convert a string that I have to a date without having to do anything too tedious.

String theD         


        
7条回答
  •  Happy的楠姐
    2020-12-02 12:36

    Try this:

    def date = Date.parse("E MMM dd H:m:s z yyyy", dateStr)
    

    Here are the patterns to format the dates

提交回复
热议问题