* limitations under the License.
* ============LICENSE_END=========================================================
*/
+
package org.onap.aai.util;
import java.time.ZoneId;
public class FormatDate {
- private final String timeZone;
- private final String pattern;
- public FormatDate(String pattern) {
- this.pattern = pattern;
- this.timeZone = "GMT";
- }
- public FormatDate(String pattern, String timeZone) {
- this.pattern = pattern;
- this.timeZone = timeZone;
- }
-
- public String getDateTime() {
-
- final DateTimeFormatter formatter =
- DateTimeFormatter.ofPattern(pattern);
- return formatter.format(ZonedDateTime.now(ZoneId.of(timeZone)));
- }
+ private final String timeZone;
+ private final String pattern;
+
+ public FormatDate(String pattern) {
+ this.pattern = pattern;
+ this.timeZone = "GMT";
+ }
+
+ public FormatDate(String pattern, String timeZone) {
+ this.pattern = pattern;
+ this.timeZone = timeZone;
+ }
+
+ public String getDateTime() {
+
+ final DateTimeFormatter formatter = DateTimeFormatter.ofPattern(pattern);
+ return formatter.format(ZonedDateTime.now(ZoneId.of(timeZone)));
+ }
}