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

IonTextWriterBuilder write timestamp fails #132

Open
simonz-bq opened this issue Mar 10, 2021 · 0 comments
Open

IonTextWriterBuilder write timestamp fails #132

simonz-bq opened this issue Mar 10, 2021 · 0 comments

Comments

@simonz-bq
Copy link
Contributor

Original issue opened by @jairveder in the QLDB-Driver repo. Moving it here as it's an Ion issue.

When using the IonTextWriterBuilder with IonTextOptions { TimestampAsMillis = false } writing of timestamps result in an System.FormatException.

Example code

{
using (var tw = new StringWriter())
using (var writer = IonTextWriterBuilder.Build(tw, new IonTextOptions { TimestampAsMillis = false }))
{
writer.Flush();
writer.StepIn(IonType.Struct);

      writer.SetFieldName("exampleDate");
      writer.WriteTimestamp(new Timestamp(exampleDate));

      writer.StepOut();
      writer.Finish();
  
      command = tw.ToString();
  }
  
  var result = IonLoader.Default.Load(command);

}
Executing this results in the following exception:
image

image

Package version: 1.0.1

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

1 participant