Package org.basex.util
Class DateTime
java.lang.Object
org.basex.util.DateTime
This class contains static, thread-safe methods for parsing and formatting dates and times.
- Author:
- BaseX Team 2005-21, BSD License, Christian Gruen
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SimpleDateFormatDate format.static final SimpleDateFormatDate format without milliseconds and timestamp (uses UTC time zone).static final SimpleDateFormatFull date format.static final SimpleDateFormatTime format.static final SimpleDateFormatTime zone. -
Method Summary
-
Field Details
-
DATETIME
Date format without milliseconds and timestamp (uses UTC time zone). -
FULL
Full date format. -
DATE
Date format. -
TIME
Time format. -
ZONE
Time zone.
-
-
Method Details
-
parse
Parses a string and produces a date object. Returns the standard base time if it cannot be converted.- Parameters:
date- string representing a date- Returns:
- parsed date
-
format
Creates a full string representation for the specified date.- Parameters:
date- date- Returns:
- string with the formatted date
-
format
Creates a string representation for a date in the specified format.- Parameters:
format- date formatdate- date- Returns:
- string with the formatted date
-