Java Millisecond Convert getTimestampMillis(Locale locale)

Here you can find the source of getTimestampMillis(Locale locale)

Description

Gets timestamp millis.

License

Apache License

Parameter

Parameter Description
locale the locale

Return

the timestamp millis

Declaration

public static String getTimestampMillis(Locale locale) 

Method Source Code

//package com.java2s;
/*/* w  ww.j ava 2s  . c  o  m*/
 * Copyright (c) 2016 Martin Pfeffer
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import java.text.SimpleDateFormat;

import java.util.Date;

import java.util.Locale;

public class Main {
    /**
     * Gets timestamp millis.
     *
     * @return the timestamp millis
     */
    public static String getTimestampMillis() {
        return new SimpleDateFormat("yyyyMMddhhmmssSSS").format(new Date());
    }

    /**
     * Gets timestamp millis.
     *
     * @param locale the locale
     * @return the timestamp millis
     */
    public static String getTimestampMillis(Locale locale) {
        return new SimpleDateFormat("yyyyMMddhhmmssSSS", locale).format(new Date());
    }
}

Related

  1. getTimeFromMillisAsNICSDate(long timeInMillis)
  2. getTimeInMillisFromNicsDateString(String dateString)
  3. getTimeMillis(String dateStr)
  4. getTimeMillis(String time)
  5. getTimestamp(long milliseconds)
  6. getTimeStr(final long millis)
  7. getTimeString(long millis)
  8. getTimeString(long timelnMillis)
  9. getTimeTakenAsSecondsString(long timeTakenMillis)