Package com.couchbase.client.java.search
Class SearchUtils
- java.lang.Object
-
- com.couchbase.client.java.search.SearchUtils
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Date
fromFtsString(String date)
Attempts to convert a date string, as returned by the FTS service, into aDate
.static String
toFtsUtcString(Date date)
Converts a date to the default string representation in FTS (RFC 3339).
-
-
-
Method Detail
-
toFtsUtcString
public static String toFtsUtcString(Date date)
Converts a date to the default string representation in FTS (RFC 3339).- Parameters:
date
- theDate
to convert.- Returns:
- the RFC 3339 representation of the date, in UTC timezone (eg. "2016-01-19T14:44:01Z")
-
fromFtsString
public static Date fromFtsString(String date)
Attempts to convert a date string, as returned by the FTS service, into aDate
.The FTS service is expected to return date strings in RFC 3339 format, including the timezone information. For example:
2016-01-10T14:44:01-08:00
for a date in the UTC-8/PDT timezone.- Parameters:
date
- the date in RFC 3339 format.- Returns:
- the corresponding
Date
. - Throws:
CouchbaseException
- when the date could not be parsed.
-
-