functions-framework-php icon indicating copy to clipboard operation
functions-framework-php copied to clipboard

CE timestamps should be returned as Time objects, not strings

Open ace-n opened this issue 4 years ago • 4 comments

As requested by @grayside in this PR.

ace-n avatar Jan 28 '21 21:01 ace-n

To clarify, the CloudEvent implementation in the Functions Framework currently returns a string timestamp. It would be useful if it returned a structured time object.

grayside avatar Mar 18 '21 20:03 grayside

cc @bshaffer

ace-n avatar Mar 18 '21 21:03 ace-n

What is the format used by CloudEvents to convert to and from?

bshaffer avatar Mar 18 '21 23:03 bshaffer

This is an example time attribute HTTP header:

ce-time: "2020-04-07T17:57:33.647Z"

https://github.com/cloudevents/spec/blob/v1.0/spec.md#time https://tools.ietf.org/html/rfc3339

Maybe DateTime::createFromFormat the property? I assume a type change would be a breaking change?

grant avatar Mar 19 '21 00:03 grant