Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: Change createdAt format on MessageConverter #71

Closed
prolic opened this issue Aug 10, 2018 · 7 comments
Closed

RFC: Change createdAt format on MessageConverter #71

prolic opened this issue Aug 10, 2018 · 7 comments
Labels

Comments

@prolic
Copy link
Member

prolic commented Aug 10, 2018

Current MessageConverter actually doesn't convert the createdAt field but returns a DateTimeImmutable object, which means that in order to send via network you have to convert it again to string.

I would like to propose that the createdAt field will get converted to string by default with format 'Y-m-d\TH:i:s.u\Z

Thoughts?

/cc @fritz-gerneth @enumag @basz

@basz
Copy link
Member

basz commented Aug 10, 2018

sound logical to have everything ready to be sent via a network.The uuid is also converted.

'uuid' => $message->uuid()->toString(),

That's not an ATOM format you propose cause it contains microseconds. Isn't there a DateTime::ATOM_WITH_MICRO format out there?

@prolic
Copy link
Member Author

prolic commented Aug 10, 2018

The uuid is already converted to string, and no, there is no ATOM_WITH_MICRO format or anything else that comes near.

@enumag
Copy link
Member

enumag commented Aug 10, 2018

Afaik there is only DateTime::RFC3339_EXTENDED which only contains milliseconds, not microseconds. None of the formats in DateTime constants has microseconds sadly.

👍 on this proposal although I'd use P for timezone instead of Z.

@fritz-gerneth
Copy link
Contributor

Yes please. This certainly is part of message serialization.

Not sure about the timezone part though. We just run everything on UTC and convert it to local time where necessary. I understand MySQL does this on the DB level only for TIMESTAMP but not for DATETIME, making it just drop the timezone information. This potentially would cause serious issues should events be created in different timezones anyway? For other DBs I have no knowledge how they behave.

@prolic
Copy link
Member Author

prolic commented Aug 11, 2018

We recommend already to use UTC, however you're free to use something else (even if that's stupid).

@prolic
Copy link
Member Author

prolic commented Aug 11, 2018

Implemented on develop-branch: https://github.com/prooph/common/tree/develop

@prolic
Copy link
Member Author

prolic commented Aug 20, 2018

This library will receive support until December 31, 2019 and will then be deprecated.

For further information see the official announcement here: https://www.sasaprolic.com/2018/08/the-future-of-prooph-components.html

@prolic prolic closed this as completed Aug 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants