Retrieveing period as date

Dear community,
is there a way a period can be retrieved in an API as date?
currently when I send a request it comes as a string
{“dataValues”:[{“dataElement”:“xlr1eEkp4ET”,“period”:“20221125”,“orgUnit”:“jGTjMDQf0gO”,“categoryOptionCombo”:“w96GJbjNMkK”,“attributeOptionCombo”:“ow8oC0E09gx”,“value”:“11”,“storedBy”:“admin”,“created”:“2022-11-26T11:17:18.964+0000”,“lastUpdated”:“2022-11-26T11:17:18.964+0000”,“followup”:false}}
as you can see here period is a string, is there a way I can retrieve it in a date format?

Thanks

Pachat

1 Like

Interesting question @Pacifique_Hategekima!

It seems the API follows a specific date format for each period type, see docs here.

Are you using these API request for app development or integration? If not maybe using a SQL query is another option because you will be able to display the dates in whichever format you want.

Thanks!

1 Like