Java Date String to String dateToFileName(String date)

Here you can find the source of dateToFileName(String date)

Description

date To File Name

License

Open Source License

Declaration

public static String dateToFileName(String date) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static String dateToFileName(String date) {
        String separator = "_";
        date = date.replaceAll(" ", separator);
        date = date.replaceAll("\\.", separator);
        date = date.replaceAll(":", separator);
        date = date.replaceAll("-", separator);
        date = date.replaceAll("/", separator);
        return date;
    }/*from  ww  w .j  a  v a2 s .  c o m*/
}

Related

  1. dateToDateEN(String in)
  2. dateToInt(String date)
  3. dateToString(String date)
  4. dateToString(String date, String month)
  5. adjustDate(String format, String value)