Strapi "updateAt" time formatting?

System Information
  • Strapi Version: v4

I am needing to convert UNIX time into the time formatting from Strapi’s updatedAt:

I have this with Strapi: 2022-09-30T19:06:14.242Z
and this with Jekyll: 2022-09-30T18:48:49+00:00

via Ruby

Time.at(1664563729).utc.to_datetime

I may need to only check date and time.


Actually, to think about it; wouldn’t it be smart to add a UNIX time option for date Strapi module.

Update:

I have found this Ruby reference to determine the formatting.
https://apidock.com/ruby/DateTime/strftime

%Y%jT%H%MZ       => 2007323T0837Z             Ordinal date and UTC of day (basic)

This is what I ended up with:

local_modify_time = DateTime.strptime(local_product["attributes"]["updatedAt"], '%Y-%m-%dT%H:%M:%S')
::DOCUMENT PRODUCT DEBUG:: Remote Stripe Product Modify Time: 1664590721
...
::DOCUMENT PRODUCT DEBUG:: Remote Product: Title updated at: 2022-10-01T02:18:41+00:00 
::DOCUMENT PRODUCT DEBUG:: Local Product: Title updated at: 2022-10-01T02:19:05+00:00

:medal_sports: