#1 2025-01-10 22:01:20

ertank
Member
Registered: 2016-03-16
Posts: 173

RecordSaveJson - custom format for TDateTime

Hello,

There are some web services insisting on "yyyy-mm-dd hh:nn:ss" format. Sometimes they even put only php format string "Y-m-d H:i:s" as their requirement.

Is it possible to have mORMot2 to serialize TDateTime values using a custom format?

Thanks & Regards,
Ertan

Offline

#2 2025-01-11 11:17:08

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,778
Website

Re: RecordSaveJson - custom format for TDateTime

You can overwrite the TDateTime format, but it would be global for the whole process.
IMHO this is not a good idea.

I would just use a RawUtf8 field with manual serialization instead.

Offline

Board footer

Powered by FluxBB