How to convert yyyy-mm-ddT00:00:00.000Z format to yyyy-mm-dd format? #3849
Unanswered
positivedeveloper36
asked this question in
Help
Replies: 1 comment 2 replies
-
Hello, Have you try to use luxonjs which is the package which provide the DateTime type? Using it with the format method can solve you're issue (and using the serializer) |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
My query like this :
If the query run and I check in the postman, the result of date_from is yyyy-mm-ddT00:00:00.000Z
I search reference and I find to add this in the model like this ::
I check call from the postman and it works, the result : yyyy-mm-dd
I need to change result of my query like this ::
When I change the script like that and check the result, the format back change to yyyy-mm-ddT00:00:00.000Z
I try add moment js like this : date_from: moment(period.dateFrom).format('YYYY-MM-DD'), it success to yyyy-mm-dd format. But the date is the current date not the date in the table of database
How can I solve this problem?
Note ::
field in the migration like this :
I use serialize like below. But it does not works
Beta Was this translation helpful? Give feedback.
All reactions