/*******************************************************************************
 * Copyright (c) 2016 Oak Ridge National Laboratory.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 ******************************************************************************/
package org.csstudio.java.time;

import java.time.Instant;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;

/** Time stamp formats
 *
 *  <p>Java 8 introduced {@link Instant} which handles time stamps
 *  with up to nanosecond detail, obsoleting custom classes
 *  for wrapping control system time stamps.
 *
 *  <p>The {@link DateTimeFormatter} is immutable and thread-safe,
 *  finally allowing re-use of common time stamp formatters.
 *
 *  <p>The formatters defined here are suggested for CS-Studio time stamps
 *  because they can show the full detail of control system time stamps in a portable way,
 *  independent from locale.
 *
 *  @author Kay Kasemir
 */
public class TimestampFormats
{
    final private static ZoneId zone = ZoneId.systemDefault();
    final private static String FULL_PATTERN = "yyyy/MM/dd HH:mm:ss.nnnnnnnnn";
    final private static String SECONDS_PATTERN = "yyyy/MM/dd HH:mm:ss";

    /** Time stamp format for 'full' time stamp */
    final public static DateTimeFormatter FULL_FORMAT= DateTimeFormatter.ofPattern(FULL_PATTERN).withZone(zone);

    /** Time stamp format for time stamp up to seconds, but not nanoseconds */
    final public static DateTimeFormatter SECONDS_FORMAT = DateTimeFormatter.ofPattern(SECONDS_PATTERN).withZone(zone);
}

@@ -1279,36 +1279,36 @@
 _PATTERN = %22yyyy
-/MM/
+-MM-
 dd HH:mm:ss.nnnn
@@ -1315,16 +1315,91 @@
 nnnnn%22;%0A
+    final private static String MILLI_PATTERN = %22yyyy-MM-dd HH:mm:ss.SSS%22;%0A
     fina
@@ -1449,12 +1449,12 @@
 yyyy
-/MM/
+-MM-
 dd H
@@ -1629,16 +1629,197 @@
 zone);%0A%0A
+    /** Time stamp format for time stamp down to milliseconds */%0A    final public static DateTimeFormatter MILLI_FORMAT= DateTimeFormatter.ofPattern(MILLI_PATTERN).withZone(zone);%0A%0A
     /** 

Add format for milliseconds.