Date, Time, DayToNumber,DayToString and SiteDateTime Blocks
The Date, Time, DayToNumber, DayToString and SiteDateTime blocks allow the user to grab specific info depending on the starting point:
- date: grabs the date part of a date time point value
- time: grabs the time part of a date time point value
- dayToNumber: converts the date into a number
- dayToString: converts a part of date into a string
- siteDateTime: get the current data and time for the site associated with the target Ref of the bline program
These are the main blocks, but there are 2 other blocks that provide specific operations for the time:
- dateTimeAdd: add a duration from a dateTime. (minutes are the assumed unit)
- dateTimeSub: substract a duration from a dateTime (minutes are the assumed unit)
The Blocks can be found in the B-Line app, after creating a new program.
Date & Time Block Properties
All the date & time blocks accept only one parameter, but some have an extra option hidden inside them. The user can reach that by clicking on the block.
Using the Date/Time Block
After the user has created or opened a new or existing program, in the Runcycle, the date/time block can be used inside different other blocks like: SET, IF, RETURN....
Let say we have a SET block already and the user wants to get the current data and time for the site associated with the target Ref of the bline program. Once the SET block has been added, the user will just type siteDateTime and the block will appear as an option.
(Click to enlarge)
Once the block has been selected it will look like this:
Example Date/Time Setup
The above screenshot represents several examples of the date/time block usage.
- a tag will get the date and time value from the site associated with the target Ref of the program
- another tag will get only the time value from a date & time tag(the one create at the first step)
- then using the dateToString block the value only for the weekday and month are picked from the same time
- finally using the dateToNumber block there are several numbers collected from the same tag for
Click on the link below to watch a video demonstration on how the above example was set up!