Stay organized with collections
Save and categorize content based on your preferences.
TimeDefinition
class TimeDefinition
A definition of the way a local time can be converted to the actual transition date-time.
Time zone rules are expressed in one of three ways:
- Relative to UTC
- Relative to the standard offset in force
- Relative to the wall offset (what you would see on a clock on the wall)
Summary
Enum values |
The local date-time is expressed in terms of the standard offset.
|
The local date-time is expressed in terms of the UTC offset.
|
The local date-time is expressed in terms of the wall offset.
|
Public methods |
LocalDateTime! |
Converts the specified local date-time to the local date-time actually seen on a wall clock.
|
Enum values
Public methods
createDateTime
fun createDateTime(
dateTime: LocalDateTime!,
standardOffset: ZoneOffset!,
wallOffset: ZoneOffset!
): LocalDateTime!
Converts the specified local date-time to the local date-time actually seen on a wall clock.
This method converts using the type of this enum. The output is defined relative to the 'before' offset of the transition.
The UTC type uses the UTC offset. The STANDARD type uses the standard offset. The WALL type returns the input date-time. The result is intended for use with the wall-offset.
Parameters |
dateTime |
LocalDateTime!: the local date-time, not null |
standardOffset |
ZoneOffset!: the standard offset, not null |
wallOffset |
ZoneOffset!: the wall offset, not null |
Return |
LocalDateTime! |
the date-time relative to the wall/before offset, not null |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# ZoneOffsetTransitionRule.TimeDefinition\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nTimeDefinition\n==============\n\n```\nclass TimeDefinition\n```\n\n|---|---|-------------------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) |||\n| ↳ | [kotlin.Enum](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-enum/index.html)\\\u003c[java.time.zone.ZoneOffsetTransitionRule.TimeDefinition](#)\\\u003e ||\n| | ↳ | [java.time.zone.ZoneOffsetTransitionRule.TimeDefinition](#) |\n\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known Direct Subclasses [ZoneOffsetTransitionRule.TimeDefinition.STANDARD](#ENUM_VALUE:STANDARD), [ZoneOffsetTransitionRule.TimeDefinition.UTC](#ENUM_VALUE:UTC), [ZoneOffsetTransitionRule.TimeDefinition.WALL](#ENUM_VALUE:WALL) |--------------------------------------------------------------------------|-------------------------------------------------------------------| | [ZoneOffsetTransitionRule.TimeDefinition.STANDARD](#ENUM_VALUE:STANDARD) | The local date-time is expressed in terms of the standard offset. | | [ZoneOffsetTransitionRule.TimeDefinition.UTC](#ENUM_VALUE:UTC) | The local date-time is expressed in terms of the UTC offset. | | [ZoneOffsetTransitionRule.TimeDefinition.WALL](#ENUM_VALUE:WALL) | The local date-time is expressed in terms of the wall offset. | |\n\nA definition of the way a local time can be converted to the actual transition date-time.\n\nTime zone rules are expressed in one of three ways:\n\n- Relative to UTC\n- Relative to the standard offset in force\n- Relative to the wall offset (what you would see on a clock on the wall)\n\nSummary\n-------\n\n| Enum values ||\n|----------------------------------------------------------------------------------------------------|---|\n| [STANDARD](#ENUM_VALUE:STANDARD) The local date-time is expressed in terms of the standard offset. |\n| [UTC](#ENUM_VALUE:UTC) The local date-time is expressed in terms of the UTC offset. |\n| [WALL](#ENUM_VALUE:WALL) The local date-time is expressed in terms of the wall offset. |\n\n| Public methods ||\n|------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [LocalDateTime](../LocalDateTime.html#)! | [createDateTime](#createDateTime(java.time.LocalDateTime,%20java.time.ZoneOffset,%20java.time.ZoneOffset))`(`dateTime:` `[LocalDateTime](../LocalDateTime.html#)!`, `standardOffset:` `[ZoneOffset](../ZoneOffset.html#)!`, `wallOffset:` `[ZoneOffset](../ZoneOffset.html#)!`)` Converts the specified local date-time to the local date-time actually seen on a wall clock. |\n\nEnum values\n-----------\n\n### STANDARD\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nenum val STANDARD : ZoneOffsetTransitionRule.TimeDefinition\n```\n\nThe local date-time is expressed in terms of the standard offset. \n\n### UTC\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nenum val UTC : ZoneOffsetTransitionRule.TimeDefinition\n```\n\nThe local date-time is expressed in terms of the UTC offset. \n\n### WALL\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nenum val WALL : ZoneOffsetTransitionRule.TimeDefinition\n```\n\nThe local date-time is expressed in terms of the wall offset.\n\nPublic methods\n--------------\n\n### createDateTime\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun createDateTime(\n dateTime: LocalDateTime!, \n standardOffset: ZoneOffset!, \n wallOffset: ZoneOffset!\n): LocalDateTime!\n```\n\nConverts the specified local date-time to the local date-time actually seen on a wall clock.\n\nThis method converts using the type of this enum. The output is defined relative to the 'before' offset of the transition.\n\nThe UTC type uses the UTC offset. The STANDARD type uses the standard offset. The WALL type returns the input date-time. The result is intended for use with the wall-offset.\n\n| Parameters ||\n|------------------|-------------------------------------------------------------------------|\n| `dateTime` | [LocalDateTime](../LocalDateTime.html#)!: the local date-time, not null |\n| `standardOffset` | [ZoneOffset](../ZoneOffset.html#)!: the standard offset, not null |\n| `wallOffset` | [ZoneOffset](../ZoneOffset.html#)!: the wall offset, not null |\n\n| Return ||\n|------------------------------------------|------------------------------------------------------------|\n| [LocalDateTime](../LocalDateTime.html#)! | the date-time relative to the wall/before offset, not null |"]]