Android Timestamp Get getFriendlyTimeStamp()

Here you can find the source of getFriendlyTimeStamp()

Description

Get date/time stamp with spaces replaced with underscores.

Declaration

public static String getFriendlyTimeStamp() 

Method Source Code

//package com.java2s;

import java.text.SimpleDateFormat;
import java.util.Date;

public class Main {
    /**/*from   w  ww  .ja v  a  2  s  . c  om*/
     * Get date/time stamp with spaces replaced with underscores.
     * Typically needed when it has to be used in a file name, etc.
     * @return
     */
    public static String getFriendlyTimeStamp() {

        return new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date());
    }
}

Related

  1. getCurrentMonth(Timestamp t1)
  2. getCurrentWeek(Timestamp t1)
  3. getFirstOfMonth(Timestamp t1)
  4. getFirstOfYear(Timestamp t1)
  5. getLastOfMonth(Timestamp t1)
  6. getLastOfYear(Timestamp t1)
  7. getRelativeTimeofTweet(String timeStamp)
  8. getTimestamp(Timestamp timestamp, int day, int hour, int minute)