Java Utililty Methods Now

List of utility methods to do Now

Description

The list of methods to do Now are organized into topic(s).

Method

Stringnow(String s, Date date)
now
SimpleDateFormat simpledateformat = new SimpleDateFormat(s);
String s1 = simpledateformat.format(date);
return s1;
Stringnow_TimeZone_BY()
no Time ZonBY
setBelarusTimeZone();
String result = new SimpleDateFormat(DATE_FORMAT_NOW, DATE_LOCALE).format(Calendar.getInstance().getTime());
return result;
StringnowAs14CharString()
now As Char String
final DateFormat format = new SimpleDateFormat("yyyyMMddHHmmss");
return format.format(new Date());
StringnowAsAnsiDate()
return current date in ANSI format (YYYYmmdd)
return asAnsiDate(GregorianCalendar.getInstance(utcTZ));
StringnowAsString()
Return "now" as readable string (date in yyyy/MM/dd format)
return nowAsString("yyyy/MM/dd HH:mm:ss z");
StringnowAsXSDDateTimeString()
now As XSD Date Time String
return calendarToXSDDateTimeString(new GregorianCalendar());
StringnowDate()
now Date
SimpleDateFormat sdf = new SimpleDateFormat(DEFAULT_YMD_FORMAT);
return sdf.format(new Date());
DatenowDate(final String formatter)
now Date
String str = "";
final SimpleDateFormat sdf = new SimpleDateFormat(formatter);
Date date = new Date();
try {
    str = sdf.format(date);
    date = sdf.parse(str);
} catch (final ParseException e) {
    e.printStackTrace();
...
StringnowDate(String strFormat)
now Date
java.util.Date date = new java.util.Date();
return getDateParser(strFormat).format(date);
StringnowDateString()
now Date String
return nowDateString(defaultDatePattern);