AEM 6.5 Date time picker not storing the seconds when i added the date and time in the dialog field.
the seconds always stored as .2022-02-09T11:51:00.000+05:30.PFB screenshot. I need to store seconds as well in the datetime field
---
Thanks,
Naresh
Solved! Go to Solution.
Views
Replies
Total Likes
@naresh19 I do not see any error while persisting date using given format.
Try some other date formats and see if works for you
ex: YYYY-MM-DD[T]HH:mm:ss.000Z
Check below link -
https://aem4beginner.blogspot.com/aem-time-formats
@naresh19 Please check valueFormat property for your Usecase:
No luck. i am getting below error msg
---
@naresh19 I do not see any error while persisting date using given format.
Try some other date formats and see if works for you
ex: YYYY-MM-DD[T]HH:mm:ss.000Z
Check below link -
https://aem4beginner.blogspot.com/aem-time-formats
Hi @naresh19, I think that the only OOTB way to achieve your goal is to change displayedFormat property to allow set seconds value, e.g. MM-DD-YYYY hh:mm:ss. The reason of that is a fact that you need to somehow provide value of seconds that you would like to store in repository. datepicker component will not be able to distinguish value of seconds by itself - user needs to set it - but to make it possible displayedFormat needs to allow to set seconds value.
valueFormat property will not be the case, because as I already wrote above - you have to provide seconds value first.
Alternative solutions will be to create your custom datepicker or what could be simpler, create and use SlingPostProcessor to calculate seconds and add it to the to the value from datepicker.