0

I'm using MongoDB Realm which generates a GraphQL server on top of your data. It only allows primitive types in the resolver return type so I had to return the date as a string.

For some reason my date is coming back in this format 0001-01-01 23:00:00 +0000 UTC and I cannot parse it with moment.

What is this format called and how am I supposed to fix this? I don't know the name of the format to even find out how to return it correctly.

Any help would be greatly appreciated.

Thanks

Oli
  • 3
  • 2

1 Answers1

0

That doesn't look like any of the typical formats. It looks like some hybrid of iso8601 and the traditional Unix date/time format.

I suggest examining the serialization code that produces this value to explicitly specify the desired format (such as iso8601).

You could alternatively fudge it in the frontend by replacing the first space with T, deleting the second space and everything following and appending Z to arrive at 0001-01-01T23:00:00Z which should parse as iso8601.

D. SM
  • 13,584
  • 3
  • 12
  • 21