Top Description Fields Constructors Methods
org.apache.poi.ss.formula.functions

public Class TimeValue

extends Fixed1ArgFunction
Class Inheritance
Imports
org.apache.logging.log4j.LogManager, .Logger, org.apache.poi.ss.formula.eval.*, org.apache.poi.ss.usermodel.DateUtil, org.apache.poi.ss.util.DateParser, java.time.DateTimeException, .LocalDate

Implementation for the TIMEVALUE() Excel function.

Syntax:
TIMEVALUE(date_text)

The TIMEVALUE function converts a time that is stored as text to a serial number that Excel recognizes as a date/time. For example, the formula =TIMEVALUE("1/1/2008 12:00") returns 0.5, the serial number of the time 12:00. The date element is ignored (see DateValue). Remember, though, that your computer's system date setting may cause the results of a TIMEVALUE function to vary from this example.

The TIMEVALUE function is helpful in cases where a worksheet contains dates/times in a text format that you want to filter, sort, or format as times, or use in time calculations.

To view a date serial number as a time, you must apply a times format to the cell.

Field Summary

Modifier and TypeField and Description
private static final Logger

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public ValueEval
private NumberEval
Inherited from org.apache.poi.ss.formula.functions.Fixed1ArgFunction:
evaluate

Field Detail

LOGback to summary
private static final Logger LOG

Constructor Detail

TimeValueback to summary
public TimeValue()

Method Detail

evaluateback to summary
public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval dateTimeTextArg)

Implements org.apache.poi.ss.formula.functions.Function1Arg.evaluate.

Doc from org.apache.poi.ss.formula.functions.Function1Arg.evaluate.

see Function#evaluate(ValueEval[], int, int)

Annotations
@Override
parseTimeFromDateTimeback to summary
private NumberEval parseTimeFromDateTime(String dateTimeText) throws EvaluationException