org.apache.pig.piggybank.evaluation.datetime.truncate
Class ISOHelper
java.lang.Object
org.apache.pig.piggybank.evaluation.datetime.truncate.ISOHelper
public class ISOHelper
- extends Object
ISOHelper provides helper methods for the other classes in this package.
- Jodatime: http://joda-time.sourceforge.net/
- ISO8601 Date Format: http://en.wikipedia.org/wiki/ISO_8601
This class is public so that it can be tested in TestTruncateDateTime.
Otherwise, it would have "package" visibility.
Field Summary |
static org.joda.time.DateTimeZone |
DEFAULT_DATE_TIME_ZONE
Default time zone for use in parsing, regardless of System or JDK's
default time zone. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_DATE_TIME_ZONE
public static final org.joda.time.DateTimeZone DEFAULT_DATE_TIME_ZONE
- Default time zone for use in parsing, regardless of System or JDK's
default time zone.
ISOHelper
public ISOHelper()
parseDateTime
public static org.joda.time.DateTime parseDateTime(Tuple input)
throws ExecException
- Parameters:
input
- a non-null, non-empty Tuple,
whose first element is a ISO 8601 string representation of a date, time, or dateTime;
with optional time zone.
- Returns:
- a DateTime representing the date,
with DateTimeZone set to the time zone parsed from the string,
or else DateTimeZone.defaultTimeZone() if one is set,
or else UTC.
- Throws:
ExecException
- if input is a malformed or empty tuple.
This method is public so that it can be tested in TestTruncateDateTime.
Otherwise, it would have "package" visibility.
Copyright © 2007-2012 The Apache Software Foundation