<commit_before>/*******************************************************************************
 * 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 <NAME>
 */
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);
}<commit_msg>o.c.java.TimestampFormats: Add format for milliseconds.<commit_after>/*******************************************************************************
 * 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 <NAME>
 */
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 MILLI_PATTERN = "yyyy-MM-dd HH:mm:ss.SSS";
    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 down to milliseconds */
    final public static DateTimeFormatter MILLI_FORMAT= DateTimeFormatter.ofPattern(MILLI_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);
}
{'fraction_non_alphanumeric': 0.15760869565217392, 'fraction_numerical': 0.004658385093167702, 'mean_word_length': 4.768656716417911, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4159356', 'n_tokens_mistral': 1059, 'n_tokens_neox': 982, 'n_words': 370}