ParseTime

See javadoc - uk.gov.gchq.koryphe.impl.function.ParseTime

Available since Koryphe version 1.8.0

Parses a date string into a timestamp

Examples

Parse time

Java
JSON
Full JSON
Python
final ParseTime parseTime = new ParseTime();
{
  "class" : "ParseTime",
  "timeUnit" : "MILLISECOND"
}
{
  "class" : "uk.gov.gchq.koryphe.impl.function.ParseTime",
  "timeUnit" : "MILLISECOND"
}
g.ParseTime( 
  time_unit="MILLISECOND" 
)

Input type:

java.lang.String

Example inputs:

Input TypeInputResult TypeResult
java.lang.String2015-10-21 16:29:00.000java.lang.Long1445444940000
java.lang.String1985-10-26 09:00:00.000java.lang.Long499165200000
java.lang.String1885-01-01 12:00:00.000java.lang.Long-2682244800000

Parse formatted time

Java
JSON
Full JSON
Python
final ParseTime parseTime = new ParseTime().format("yyyy-MM hh:mm");
{
  "class" : "ParseTime",
  "format" : "yyyy-MM hh:mm",
  "timeUnit" : "MILLISECOND"
}
{
  "class" : "uk.gov.gchq.koryphe.impl.function.ParseTime",
  "format" : "yyyy-MM hh:mm",
  "timeUnit" : "MILLISECOND"
}
g.ParseTime( 
  format="yyyy-MM hh:mm", 
  time_unit="MILLISECOND" 
)

Input type:

java.lang.String

Example inputs:

Input TypeInputResult TypeResult
java.lang.String2015-10 16:29java.lang.Long1443716940000
java.lang.String1985-10 09:00java.lang.Long497005200000
java.lang.String1885-01 12:00java.lang.Long-2682288000000
java.lang.String2015-10-21 16:29IllegalArgumentException: Date string could not be parsed: 2015-10-21 16:29

Parse formatted greenwich mean time

Java
JSON
Full JSON
Python
final ParseTime parseTime = new ParseTime()
        .format("yyyy-MM-dd")
        .timeUnit("SECOND")
        .timeZone("GMT");
{
  "class" : "ParseTime",
  "format" : "yyyy-MM-dd",
  "timeZone" : "GMT",
  "timeUnit" : "SECOND"
}
{
  "class" : "uk.gov.gchq.koryphe.impl.function.ParseTime",
  "format" : "yyyy-MM-dd",
  "timeZone" : "GMT",
  "timeUnit" : "SECOND"
}
g.ParseTime( 
  time_zone="GMT", 
  format="yyyy-MM-dd", 
  time_unit="SECOND" 
)

Input type:

java.lang.String

Example inputs:

Input TypeInputResult TypeResult
java.lang.String2015-10-21 16:29:00.000java.lang.Long1445385600
java.lang.String1985-10-26 09:00:00.000java.lang.Long499132800
java.lang.String1885-01-01 12:00:00.000java.lang.Long-2682288000

results matching ""

    No results matching ""