org.apache.solr.common.util.DateUtil Java Examples
The following examples show how to use
org.apache.solr.common.util.DateUtil.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CollectionPerTimeFrameAssignmentStrategy.java From storm-solr with Apache License 2.0 | 5 votes |
public Date asTimestamp(Object obj) throws ParseException { Date ts; if (obj instanceof String) { ts = DateUtil.parseDate((String) obj); } else if (obj instanceof Date) { ts = (Date)obj; } else if (obj instanceof Calendar) { ts = ((Calendar)obj).getTime(); } else if (obj instanceof Long) { ts = new Date((Long)obj); } else { ts = DateUtil.parseDate(obj.toString()); } return ts; }