{"action":"created","issue":{"url":"https://api.github.com/repos/JodaOrg/joda-time/issues/256","labels_url":"https://api.github.com/repos/JodaOrg/joda-time/issues/256/labels{/name}","comments_url":"https://api.github.com/repos/JodaOrg/joda-time/issues/256/comments","events_url":"https://api.github.com/repos/JodaOrg/joda-time/issues/256/events","html_url":"https://github.com/JodaOrg/joda-time/issues/256","id":62700186,"number":256,"title":"Fraction of Second Parsing adds an additional zero in case fraction is empty","user":{"login":"selmantayyar","id":1129967,"avatar_url":"https://avatars.githubusercontent.com/u/1129967?v=3","gravatar_id":"","url":"https://api.github.com/users/selmantayyar","html_url":"https://github.com/selmantayyar","followers_url":"https://api.github.com/users/selmantayyar/followers","following_url":"https://api.github.com/users/selmantayyar/following{/other_user}","gists_url":"https://api.github.com/users/selmantayyar/gists{/gist_id}","starred_url":"https://api.github.com/users/selmantayyar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/selmantayyar/subscriptions","organizations_url":"https://api.github.com/users/selmantayyar/orgs","repos_url":"https://api.github.com/users/selmantayyar/repos","events_url":"https://api.github.com/users/selmantayyar/events{/privacy}","received_events_url":"https://api.github.com/users/selmantayyar/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-18T13:55:56Z","updated_at":"2015-03-21T23:09:52Z","closed_at":null,"body":"Hello,\r\n\r\nI am trying to parse the following date with Joda time:\"2007-12-14T12:34:56\"\r\nI need to parse also fraction of second parts in case i have a date like \"2007-12-14T12:34:56.789Z\"\r\n\r\nHowever,in the first case my formatter adds \".0\" to the given date.Code is available below.It outputs\r\n\"2007-12-14T12:34:56.0\"  instead of \"2007-12-14T12:34:56\"\r\n\r\nThanks in advance for your help.\r\n\r\nP.S:I am using version 2.7\r\n\r\n\tpublic static void main(String[] args) {\r\n\t\r\n\t\t\r\n\t\t DateTimeFormatter FRACTION_OF_SECOND_WITH_DOT_LITERAL_FORMATTER=new DateTimeFormatterBuilder()\r\n     \t.appendLiteral('.')\r\n     \t.appendFractionOfSecond(1, 3)\r\n     \t.toFormatter();\r\n\t\t \r\n\t\tDateTimeParser [] parsers =new DateTimeParser[]{FRACTION_OF_SECOND_WITH_DOT_LITERAL_FORMATTER.getParser(),null};\r\n\r\n\t\tDateTimeFormatter localDateHMSFormatter = new DateTimeFormatterBuilder()\r\n\t\t.append(ISODateTimeFormat.dateHourMinuteSecond()).toFormatter();\r\n\r\n\t\tDateTimeFormatter finalFormatter=new DateTimeFormatterBuilder()\r\n\t\t.append(localDateHMSFormatter)\r\n\t\t.append(FRACTION_OF_SECOND_WITH_DOT_LITERAL_FORMATTER.getPrinter(), parsers)\r\n\t\t.toFormatter();\r\n\t\t\r\n\t\tDateTime dateTime = finalFormatter.parseDateTime(\"2007-12-14T12:34:56\");\r\n\t\tString result = finalFormatter.print(dateTime);\r\n\t\tSystem.out.println(result);\r\n\r\n\t} "},"comment":{"url":"https://api.github.com/repos/JodaOrg/joda-time/issues/comments/84469200","html_url":"https://github.com/JodaOrg/joda-time/issues/256#issuecomment-84469200","issue_url":"https://api.github.com/repos/JodaOrg/joda-time/issues/256","id":84469200,"user":{"login":"jodastephen","id":213212,"avatar_url":"https://avatars.githubusercontent.com/u/213212?v=3","gravatar_id":"","url":"https://api.github.com/users/jodastephen","html_url":"https://github.com/jodastephen","followers_url":"https://api.github.com/users/jodastephen/followers","following_url":"https://api.github.com/users/jodastephen/following{/other_user}","gists_url":"https://api.github.com/users/jodastephen/gists{/gist_id}","starred_url":"https://api.github.com/users/jodastephen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jodastephen/subscriptions","organizations_url":"https://api.github.com/users/jodastephen/orgs","repos_url":"https://api.github.com/users/jodastephen/repos","events_url":"https://api.github.com/users/jodastephen/events{/privacy}","received_events_url":"https://api.github.com/users/jodastephen/received_events","type":"User","site_admin":false},"created_at":"2015-03-21T23:09:52Z","updated_at":"2015-03-21T23:09:52Z","body":"This produces a formatter that can parse both with and without milliseconds, but only prints down to the second level. I don't know if that is what you want, but in general you can combine formatters to produce almost any result. In addition , you can implement `DateTimePrinter` and `DateTimeParser` yourself and integrate them.\r\n\r\n```\r\nDateTimeFormatter finalFormatter = new DateTimeFormatterBuilder()\r\n    .append(ISODateTimeFormat.dateHourMinuteSecond().getPrinter(),\r\n        new DateTimeFormatterBuilder()\r\n            .append(ISODateTimeFormat.dateHourMinuteSecond())\r\n            .append(null, parsers).toParser())\r\n    .toFormatter();\r\n```\r\n"}}