I implemented the datetimepicker using the <sx:datetimepicker>
tag and was able to change the display format.
But now, I'm not able to change the format of the date that it outputs to the server.
I read that the date is formatted in RFC 3339 (yyyy-MM-dd'T'HH:mm:ss)
format by default.
Is there anyway I can change this to MM/dd/yyyy
.
I mean I can use SimpleDateFormat
to change the date to the format I want, but I'm also checking whether the format is in MM/dd/yyyy
in the validate()
method of my Action class.
And then I'm supposed to set the date value to a POJO, so I'll have to parse the date twice using SimpleDateFormat
which sounds like a lot of mess.
Is there anyway I can directly make the datetimepicker output the value in the format I want?