0

The string format is yyyy-MM-dd HH:mm, for example 2017-01-01 10:30.

How to parse the string to date using Gson?

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
zqiang0zh
  • 91
  • 1
  • 13

1 Answers1

1

Create Gson Object and pass Date format like this,

Gson gson = new GsonBuilder().setDateFormat(YOUR_DATE_FORMAT).create();

Hope this may help you.

Mitesh Vanaliya
  • 2,491
  • 24
  • 39