Hoppa till huvudinnehåll

//ERDDAP/com.cohort.util/ScriptCalendar2

ScriptCalendar2

[JVM]
open class ScriptCalendar2

This class makes some of the static methods in com.cohort.Calendar2 accessible to JexlScript scripts as "Calendar2.name()" methods.

The underlying Calendar2 class is Copyright (c) 2005 Robert Simons (CoHortSoftware@gmail.com). See the MIT/X-like license in com/cohort/util/LICENSE.txt.

Author

Bob Simons (was bob.simons@noaa.gov, now BobSimons2.00@gmail.com) 2019-11-20

Constructors

ScriptCalendar2[JVM]
constructor()

Properties

NameSummary
AM_PM[JVM]
val AM_PM: Int = 9
BC[JVM]
val BC: Int = 0
DATE[JVM]
val DATE: Int = 5
1..
DAY_OF_YEAR[JVM]
val DAY_OF_YEAR: Int = 6
DST_OFFSET[JVM]
val DST_OFFSET: Int = 16
in millis
ERA[JVM]
val ERA: Int = 0
These are the fields in a Calendar or GregorianCalendar object.
HOUR[JVM]
val HOUR: Int = 10
0..
HOUR_OF_DAY[JVM]
val HOUR_OF_DAY: Int = 11
0..
MILLISECOND[JVM]
val MILLISECOND: Int = 14
MINUTE[JVM]
val MINUTE: Int = 12
MONTH[JVM]
val MONTH: Int = 2
Jan=0, ...
SECOND[JVM]
val SECOND: Int = 13
YEAR[JVM]
val YEAR: Int = 1
ZONE_OFFSET[JVM]
val ZONE_OFFSET: Int = 15
in millis

Functions

NameSummary
clearSmallerFields[JVM]
open fun clearSmallerFields(epochSeconds: Double, field: Int): Double
This clears the fields smaller than 'field' (e.g., HOUR_OF_DAY clears MINUTE, SECOND, and MILLISECOND, but doesn't change HOUR_OF_DAY, MONTH, or YEAR).
epochSecondsToLimitedIsoStringT[JVM]
open fun epochSecondsToLimitedIsoStringT(time_precision: String, seconds: Double, NaNString: String): String
This is like safeEpochSecondsToIsoStringT3Z, but returns a limited precision string.
epochSecondsToUnitsSince[JVM]
open fun epochSecondsToUnitsSince(baseSeconds: Double, factorToGetSeconds: Double, epochSeconds: Double): Double
This converts an epochSeconds value into a unitsSince value.
format[JVM]
open fun format(epochSeconds: Double, pattern: String, zone: String): String
This formats the epochSeconds time value using the pattern.
getTimeBaseAndFactor[JVM]
open fun getTimeBaseAndFactor(tsUnits: String, timeZone: TimeZone): Array<Double>
This converts a string "[units] since [isoDate]" (e.g., "minutes since 1985-01-01") into a baseSeconds (seconds since 1970-01-01) and a factor ("minutes" returns 60).
parseToEpochSeconds[JVM]
open fun parseToEpochSeconds(sourceTime: String, dateTimeFormat: String): Double
A variant of parseToEpochSeconds that uses the Zulu time zone.
[JVM]
open fun parseToEpochSeconds(sourceTime: String, dateTimeFormat: String, timeZoneString: String): Double
This converts a sourceTime string into a double with epochSeconds.
tryToEpochSeconds[JVM]
open fun tryToEpochSeconds(someDateTimeString: String): Double
This tries to figure out the format of someDateTimeString then parse the value and convert it to epochSeconds.
tryToIsoString[JVM]
open fun tryToIsoString(someDateTimeString: String): String
This tries to figure out the format of someDateTimeString then parse the value and convert to an ISO 8601 string with 'Z' at end.
unitsSinceToEpochSeconds[JVM]
open fun unitsSinceToEpochSeconds(baseSeconds: Double, factorToGetSeconds: Double, unitsSince: Double): Double
This converts a unitsSince value into epochSeconds.