Package com.tngtech.jgiven.format
Class DateFormatter
java.lang.Object
com.tngtech.jgiven.format.DateFormatter
- All Implemented Interfaces:
ArgumentFormatter<Date>
General formatter to format
Date
values.
This formatter simply delegates to a SimpleDateFormat
.
- Since:
- 0.15.0
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionASimpleDateFormat
pattern is expected as first argument.
An optional second argument can be set to specify a locale as an ISO 639 language code.
-
Constructor Details
-
DateFormatter
public DateFormatter()
-
-
Method Details
-
format
ASimpleDateFormat
pattern is expected as first argument.
An optional second argument can be set to specify a locale as an ISO 639 language code.- Specified by:
format
in interfaceArgumentFormatter<Date>
- Parameters:
date
- the object to formatargs
- optional arguments for the formatter to control the formatting.- Returns:
- a formatted string
-