Package org.h2.mode

# Class ToDateParser

java.lang.Object
org.h2.mode.ToDateParser

public final class ToDateParser extends Object
Emulates Oracle's TO_DATE function.
This class holds and handles the input data form the TO_DATE-method

## Method Summary

Modifier and Type
Method
Description
`static ValueTimestamp`
`toDate(SessionLocal session, String input, String format)`
Parse a string as a date with the given format.
`String`
`toString()`
`static ValueTimestamp`
`toTimestamp(SessionLocal session, String input, String format)`
Parse a string as a timestamp with the given format.
`static ValueTimestampTimeZone`
`toTimestampTz(SessionLocal session, String input, String format)`
Parse a string as a timestamp with the given format.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Method Details

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### toTimestamp

public static ValueTimestamp toTimestamp(SessionLocal session, String input, String format)
Parse a string as a timestamp with the given format.

Parameters:
  `session` - the database session
  `input` - the input
  `format` - the format
Returns:
  the timestamp

### toTimestampTz

public static ValueTimestampTimeZone toTimestampTz(SessionLocal session, String input, String format)
Parse a string as a timestamp with the given format.

Parameters:
  `session` - the database session
  `input` - the input
  `format` - the format
Returns:
  the timestamp

### toDate

public static ValueTimestamp toDate(SessionLocal session, String input, String format)
Parse a string as a date with the given format.

Parameters:
  `session` - the database session
  `input` - the input
  `format` - the format
Returns:
  the date as a timestamp