# Date Handling
# Introduction
Date blocks are used as input parameters for other blocks. At the moment some of these blocks are found in the ephemeris section, whilst others are found in the persistence section - they may be equally useful for both. These blocks are typed to assure correct connection to other blocks.
# Overview of the Date Handling blocks
Blocks in the ephemeris section
Blocks in the persistence section
# Date Handling Blocks
# today
Type: DayOffset
Ephemeris blocks expect a date formatted as the number of days since today. As a result, this block returns 0.
# today +/- x days
Type: DayOffset
Returns the number of days since today, as configured in the number block. The number can be positive (offset into the future) or negative (offset into the past).
# date-picker
Type: ZonedDateTime
Returns a date as ZonedDateTime.
The date can be selected from a date picker.
The time is set to 00:00:00
.
# Get date
Type: ZonedDateTime
This block will return the date as ZonedDateTime based on a given String. The String may be one of the following formats
- yyyy-MM-dd
- yyyy-MM-dd HH:mm:ss
- yyyy-MM-dd HH:mm:ss +HH:mm
The input String may be a variable-block.
# Get Date now with offset
Type: ZonedDateTime
Returns a date as ZonedDateTime with offset relative to the current date and time.
The options for the time period base are
- seconds
- minutes
- hours
- days
- months
- years
# Get String representation of date
Type: String
Returns the String representation of a given ZonedDateTime-block, with or without the time.
# Example
Assuming this block is run at 20:47:36
on 31/01/2022
The output in the log will be.
2022-01-31
2022-01-31 00:00:00
2022-01-31 20:47:36