Replace joda-time with Java 8 API

joda-time is used to format dates to timestamp strings, but since change
I897188135 in core Gerrit it will no longer be exported in the plugin API
after all usage of joda-time was replaced with the Java 8 API.

Factor the timestamp formatting out to a new utility class, replacing the
usage of joda-time with Java 8's DateTimeFormatter.

Add a test which confirms that the new implementation produces the same
values as joda-time.

This change was originally done on the master branch. It is not strictly
necessary to backport to the stable-2.14 branch, since joda-time is still
included in the 2.14 API, but it will make it easier to implement changes
related to timestamps without causing reword when they're merged up to
master.

Also, note that when this change was originally reviewed on master, a
mistake related to handling of time zones was overlooked. That is fixed
in this version, so it's not a true cherry-pick.

Change-Id: I49bffffbd171065c6b3c0803a5a2bb377bd27ef1
6 files changed
tree: 5d669c6a759772a834c95db3c66c68fc22d4f016
  1. src/
  2. tools/
  3. .gitignore
  4. bazlets.bzl
  5. BUILD
  6. external_plugin_deps.bzl
  7. WORKSPACE