Grablo Help Grablo Help
  • User Manual
  • Tips
  • News
  • Go to
    • Grablo Home
    • Grablo App
  • 한국어
Grablo Help Grablo Help
문의하기
Grablo Help Grablo Help
  • User Manual
  • Tips
  • News
  • Go to
    • Grablo Home
    • Grablo App
  • 한국어
loading
  1. Home
  2. User Manuals
  3. Block Coding
  4. Blocks
  5. Date/Time
Updated on August 13, 2025

User Manuals

  • Folder icon closed Folder open iconQuick Start Guide
    • Grablo!
    • Basic Concepts
  • Folder icon closed Folder open iconProject
    • General
    • Sharing Project
  • Folder icon closed Folder open iconLogic
    • Logic
    • Control Group
    • Control
    • Condition Group
    • Action Group
    • Condition
      • General
      • Type
        • Always Met
        • Once Met
        • Variable Comparison
        • Schedule
        • Time Range
        • Time Interval
        • Condition Reference
        • Action Reference
        • Change Detection
        • Custom Condition
    • Action
      • General
      • Type
        • Write Variable
        • I/O Device Control
        • Time Delay
        • Timer
        • Display Image
        • Play Media
        • Synthesizer
        • Audio Recording
        • Audio Transform
        • Shell Command
        • Speech-to-Text
        • Text-to-Speech
        • File System
        • Read/Write File
        • Database
        • HTTP Communication
        • MQTT Communication
        • OPC UA Communication
        • Modbus Communication
        • Send Email
        • Telegram Message
        • User Defined Communication
        • PID Control
        • Statistics
        • Collection
        • Custom Action
  • Folder icon closed Folder open iconDashboard
    • General
    • Widgets
  • Folder icon closed Folder open iconSetting
    • GPIO
    • Variables
    • I/O Device
    • File Editor
    • Collection
    • Timer
    • Image Viewer
    • Audio Transfrom
    • Media Player
    • Synthesizer
    • Text-to-Speech
    • Speech-to-Text
    • Audio Recorder
    • MQTT Client
    • OPC UA Client
    • Modbus
    • Email Client
    • Telegram Bot
    • Database
    • User Defined Communication
    • PID Control
    • Statistics
  • Folder icon closed Folder open iconI/O Device
    • DS18B20 Digital Temperature Sensor
    • MAX31865 RTD Temperature Sensor
    • TinyGPS++ GPS Library
    • BMP180 Digital Pressure and Temperature Sensor
    • AHTx0 Temperature and Humidity Sensor
    • SHT2x Temperature and Humidity Sensor
    • Servo Motor Control
    • PWM Signal Output
    • PWM Signal Monitoring
    • Hardware PWM Signal Output
    • LED Control
    • Push Button Input
    • Digital I/O
    • Stepper Motor Control
    • High Speed Counter
    • ADS1x15 ADC
    • ADXL345 3-Axis Accelerometer
    • BME280 Temperature, Humidity, Pressure Sensor
    • BMP280 Temperature, Pressure Sensor
    • MLX90614 Infrared Temperature Sensor
    • MCP4725 DAC
    • QMC5883L 3-Axis Magnetometer
    • SHT31 Digital Temperature and Humidity Sensor
    • TCS34725 RGB Color Sensor
    • VEML6070 UV Sensor
    • BH1750 Digital Light Intensity Sensor
    • DS3231 RTC High-Precision Real-Time Clock
    • MPU-9250 9-Axis IMU Sensor
    • CCS811 Carbon Dioxide and TVOC Air Quality Sensor
    • VL53L0X ToF Laser Distance Sensor
    • TFmini Plus(S) LiDAR Distance Sensor
    • MAX7219 8-Digit 7-Segment Display
    • PCF8574 LCD Display Driver
    • HC-SR04 Ultrasonic Distance Sensor
    • LED Brightness Control
    • RGB LED Color Control
    • DC Motor Control
    • AT24C256 EEPROM Memory
    • DHTxx Temperature and Humidity Sensor
    • MCP3xxx ADC
    • LCD Display Driver (MCP23008, MCP23017)
    • MFRC522 RFID Reader
    • Passive Buzzer
    • NeoPixel (WS281x) LED
    • Infrared (IR) Receiver
    • NeoPixel Matrix
    • ST77xx TFT Color LCD
    • ILI9341 TFT Color LCD
    • SSD1306 0.96-inch Monochrome OLED Display
    • SH1106 1.3-inch Monochrome OLED Display
    • MAX7219 8×8 LED Dot Matrix
    • HT16K33 4-Digit 7-Segment Display
    • HX711 Load Cell 24-bit AD Converter
    • TCS3200 RGB Color Sensor
    • MPU6050 6-Axis Gyro Accelerometer
    • TM1637 4-Digit 7-Segment Display
    • PM2008(M) Particulate Matter Sensor
    • PMS x003 Particulate Matter Sensor
    • MAX30102 SpO2 and Heart Rate Sensor
    • AS608, FPM10A Fingerprint Sensor
    • TTP229 Capacitive 16-Key Touch Keypad
    • 4×4 Keypad Matrix
    • Analog to Digital Converter (ADC)
    • Digital to Analog Converter (DAC)
    • RPM Monitor
    • PCA9685 16-Channel 12-Bit PWM Servo Driver
    • INA219 DC Current Sensor
    • VL6180X ToF Distance Sensor
    • Custom Digital Waveform Output
    • NRF24L01 2.4GHz RF Module
  • Folder icon closed Folder open iconBlock Coding
    • General
    • Blocks
      • Values
      • Logic
      • Loop
      • Math
      • Date/Time
      • Text
      • Byte Array
      • List
      • Type Conversion
      • Unit Conversion
      • Science
      • Bit/Byte
      • Complex Numbers/Vectors
      • JSON
      • XML
      • Local Variables
      • Local Functions
  • Folder icon closed Folder open iconConnect & Run
    • Hardware and Operating System
    • Grablo Package Installation
    • Connect and Run

Date/Time

Estimated reading: 5 minutes 286 views

Date Input

Select a date from the calendar.

  • Input [type]: calendar selection [Date field]
  • Output [type]: selected date [Date]


Time Input

Creates a specific time value.

  • Input [type]: AM/PM, hour, minute, second [Fields]
  • Output [type]: set time [Time]


Duration Input

Creates a duration value.

  • Input [type]: hours, minutes, seconds, milliseconds [Number fields]
  • Output [type]: set duration [Duration]


Current Date

Gets the current system date.
Example: 2023-03-20

  • Input [type]: none
  • Output [type]: current date [Date]

​

Current Time

Gets the current system time.
Example: 17:11:30

  • Input [type]: none
  • Output [type]: current time [Time]

​

Current Timestamp

Gets the current date and time as a string.
Output in YYYY-MM-DD HH:MM:SS format.
Example: “2023-12-25 17:11:30”

  • Input [type]: none
  • Output [type]: timestamp string [Text]


System Uptime

Gets the time elapsed since system boot.
Can represent up to 4,294,967,295 milliseconds (approximately 49.7 days), and starts over from 0 when exceeded.
Example: 0 hours 60 minutes 30 seconds 500 milliseconds

  • Input [type]: none
  • Output [type]: elapsed time [Duration]

​

Unix Timestamp

Gets time elapsed since January 1, 1970, 00:00:00 UTC.

  • Input [type]: none
  • Output [type]: Unix time [Duration]

​

Create Date

Creates a date from year, month, and day values.
Example: 2022, 12, 1 → 2022-12-01

  • Input [type]: year [Number], month [Number], day [Number]
  • Output [type]: created date [Date]

​

Create Time

Creates a time from hour, minute, and second values.
Example: 14, 56, 30 → 14:56:30

  • Input [type]: hour [Number], minute [Number], second [Number]
  • Output [type]: created time [Time]

​

Create Duration

Creates a duration from time components.
Example: 12, 34, 56, 789 → 12 hours 34 minutes 56 seconds 789 milliseconds

  • Input [type]: hours [Number], minutes [Number], seconds [Number], milliseconds [Number]
  • Output [type]: created duration [Duration]

​

Add to Date

Adds or subtracts years, months, weeks, and days to a date.
Example: 2023-03-23 + 1 year – 3 months + 2 weeks – 5 days → 2023-12-31

  • Input [type]: date [Date], years [Number], months [Number], weeks [Number], days [Number]
  • Output [type]: calculated date [Date]

​

Add to Time

Adds or subtracts hours, minutes, and seconds to a time.
If the calculated time becomes negative or exceeds 24 hours, it calculates to the previous or next day’s time.
Example: 10:46:52 – 12 hours + 30 minutes – 50 seconds → 23:16:02

  • Input [type]: time [Time], hours [Number], minutes [Number], seconds [Number]
  • Output [type]: calculated time [Time]

​

Add to Duration

Adds or subtracts hours, minutes, seconds, and milliseconds to a duration.
If the calculated duration becomes negative, it returns 0 hours 0 minutes 0 seconds 0 milliseconds.
Example: 0 hours 10 minutes 20 seconds 100 milliseconds + 1 hour – 30 minutes + 30 seconds – 100 milliseconds → 0 hours 40 minutes 50 seconds 0 milliseconds

  • Input [type]: duration [Duration], hours [Number], minutes [Number], seconds [Number], milliseconds [Number]
  • Output [type]: calculated duration [Duration]

​

Compare Dates

Compares two dates.
Example: 2023-03-23 < 2023-03-30 → true

  • Input [type]: date1 [Date], date2 [Date]
  • Output [type]: comparison result [Digital]

​

Compare Times

Compares two times.
Example: 11:04:30 < 12:00:00 → true

  • Input [type]: time1 [Time], time2 [Time]
  • Output [type]: comparison result [Digital]

​

Compare Durations

Compares two durations.
Example: 0 hours 1 minute 0 seconds 0 milliseconds < 0 hours 2 minutes 0 seconds 0 milliseconds → true

  • Input [type]: duration1 [Duration], duration2 [Duration]
  • Output [type]: comparison result [Digital]

​

Split Date

Splits a date into an array of year, month, and day values.
Example: 2023-03-23 → list {2023, 3, 23}

  • Input [type]: date [Date]
  • Output [type]: [year, month, day] array [Array]

​

Split Time

Splits a time into an array of hour, minute, and second values.
Example: 11:10:30 → list {11, 10, 30}

  • Input [type]: time [Time]
  • Output [type]: [hour, minute, second] array [Array]

​

Split Duration

Splits a duration into an array of hours, minutes, seconds, and milliseconds.
Example: 12 hours 34 minutes 56 seconds 789 milliseconds → list {12, 34, 56, 789}

  • Input [type]: duration [Duration]
  • Output [type]: [hours, minutes, seconds, milliseconds] array [Array]

​

Day of Week

Gets the day of the week as a number.
(0:Mon, 1:Tue… 6:Sun)
When weekday name option is selected, returns as string.
Example: 2023-03-23 → Thursday → 3 (index) or “THU” (string)

  • Input [type]: date [Date]
  • Output [type]: weekday number [Number] or weekday name [String]


Leap Year Check

Checks if the year of the given date is a leap year.
A leap year is when February has 29 days in the Gregorian calendar.
Example: 2024-01-01 → true

  • Input [type]: date [Date]
  • Output [type]: leap year status [Digital]

​

Days Between Dates

Calculates the number of days between two dates.
Calculates the difference between date1 and date2 (date2-date1) in days.
Example: date1: 2023-03-23, date2: 2023-06-30 → 99

  • Input [type]: date1 [Date], date2 [Date]
  • Output [type]: day difference [Number]


Date Information

Gets the total number of days in the year, total days in the month, or day of year for the given date.
Days in year: Returns the total number of days in that year.
Days in month: Returns the total number of days in that month.
Day of year: Returns which day of the year this date represents.
Example: 2023-03-23 → 365 (days in year)

  • Input [type]: date [Date]
  • Output [type]: total days in year [Number] or total days in month [Number] or day of year [Number]


Date Range Check

Checks if a date falls within a specified range.
Tests if start date ≤ check date ≤ end date.
Example: 2023-01-01 ≤ 2023-03-23 ≤ 2023-12-31 → true

  • Input [type]: start date [Date], check date [Date], end date [Date]
  • Output [type]: within range status [Digital]

​

Seconds Between Times

Calculates the number of seconds between two times.
Calculates the difference between time1 and time2 (time2-time1) in seconds.
Example: time1: 09:00:00, time2: 11:37:30 → 9,450 seconds

  • Input [type]: time1 [Time], time2 [Time]
  • Output [type]: second difference [Number]

​

Milliseconds Between Durations

Calculates the number of milliseconds between two durations.
Calculates the difference between duration1 and duration2 (duration2-duration1) in milliseconds.
Example: duration1: 0 hours 0 minutes 0 seconds 0 milliseconds, duration2: 1 hour 30 minutes 30 seconds 500 milliseconds → 5,430,500 milliseconds

  • Input [type]: duration1 [Duration], duration2 [Duration]
  • Output [type]: millisecond difference [Number]

​

Multiply Duration

Multiplies a duration by a number.
Example: 3 hours 30 minutes 30 seconds 0 milliseconds × 2 → 7 hours 1 minute 0 seconds 0 milliseconds

  • Input [type]: duration [Duration], multiplier [Number]
  • Output [type]: scaled duration [Duration]

​

Duration to Milliseconds

Converts a duration to total milliseconds.
Example: 1 hour 30 minutes 30 seconds 500 milliseconds → 5,430,500 milliseconds

  • Input [type]: duration [Duration]
  • Output [type]: total milliseconds [Number]

​

Milliseconds to Duration

Converts milliseconds to a duration.
Example: 5,430,500 milliseconds → 1 hour 30 minutes 30 seconds 500 milliseconds

  • Input [type]: milliseconds [Number]
  • Output [type]: duration [Duration]

찾으시는 내용이 없나요? 문의하기

문의하기

공유하기

Date/Time

Or copy link

Clipboard Icon
콘탠츠

ㅤ

Grablo Inc.
support@grablo.co

Site Links

  • Grablo Home
  • Grablo App

이 사이트의 모든 컨텐츠는 저작권법에 보호받는 저작물로서, 무단으로 복제, 배포하는 경우에는 저작권법에 의하여 처벌을 받을 수 있습니다. Copyright 2024 grablo.co. All Rights Reserved.