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

Unable to format ZonedDateTime #1107

Closed
s1apped opened this issue Jun 1, 2020 · 4 comments
Closed

Unable to format ZonedDateTime #1107

s1apped opened this issue Jun 1, 2020 · 4 comments

Comments

@s1apped
Copy link

s1apped commented Jun 1, 2020

Hi,

There is an issue with ISO_ZONED_DATE_TIME format e.g 2020-01-01T10:00+01:00[Europe/Warsaw] using LambdaDslObject date.

au.com.dius.pact.consumer.MockServer)]: Illegal pattern component: V

body.date("date", "yyyy-MM-dd'T'HH:mmZZZV", ZonedDateTime.parse("2020-01-01T10:00+01:00[Europe/Warsaw]"));

Looks like the problem is that Pact is using FastDateFormat which seems to be based of SimpleDateFormat. The solution would be to move to DateTimeFormatter

@uglyog
Copy link
Member

uglyog commented Jun 7, 2020

I've updated the datetime methods to use Java DateTimeFormatter. The expression to match that value will now have to be yyyy-MM-dd'T'HH:mmXXX'['VV']'.

BTW, date was the wrong method to use. It should have been timestamp which I have now renamed to datetime.

@uglyog
Copy link
Member

uglyog commented Jun 9, 2020

4.1.1 has been released

@anto-ac
Copy link
Collaborator

anto-ac commented Jun 9, 2020

@uglyog the new test you've added is failing when building on my machine.
image (3)

@anto-ac
Copy link
Collaborator

anto-ac commented Jun 20, 2020

This was fixed and backwards compatibility with previously working date formats is guaranteed, at least for now.

@anto-ac anto-ac closed this as completed Jun 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants