Java String to Date toDateString(Date date, TimeZone timezone)

Here you can find the source of toDateString(Date date, TimeZone timezone)

Description

to Date String

License

Open Source License

Declaration

public static String toDateString(Date date, TimeZone timezone) 

Method Source Code

//package com.java2s;

import java.text.SimpleDateFormat;

import java.util.Date;

import java.util.TimeZone;

public class Main {
    public static String toDateString(Date date, TimeZone timezone) {
        if (date == null)
            return null;
        if (timezone == null)
            timezone = TimeZone.getDefault();
        SimpleDateFormat dbFmt = new SimpleDateFormat("yyyy/MM/dd");
        dbFmt.setTimeZone(timezone);//w  w  w  . j  a  va2s. co m
        return dbFmt.format(date);
    }
}

Related

  1. toDateString(Date date)
  2. toDateString(Date date, String format)
  3. toDateString(Date date, String format)
  4. toDateString(Date date, String format)
  5. toDateString(Date date, String formatPattern)
  6. toDateString(final Date date)
  7. toDateString(java.util.Date date)
  8. toDateString(java.util.Date date)
  9. toDateString(java.util.Date date, String format)