org.apache.pig.piggybank.evaluation.datetime.truncate
Class ISOHelper

java.lang.Object
  extended by org.apache.pig.piggybank.evaluation.datetime.truncate.ISOHelper

public class ISOHelper
extends Object

ISOHelper provides helper methods for the other classes in this package.

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.
 
Constructor Summary
ISOHelper()
           
 
Method Summary
static org.joda.time.DateTime parseDateTime(Tuple input)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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.

Constructor Detail

ISOHelper

public ISOHelper()
Method Detail

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