B2Win Suite Documentation (Under Construction)
ContactB2Data
5.6
5.6
  • B2Win Suite Documentation
  • Scripting
    • B2Win Suite Scripting Overview
    • Scripting in B2Data
      • Custom Script Nodes
        • Custom Script
        • Source Script Node (File)
        • Source Script Node (Table)
        • Source Script Node (Object)
        • If-Else Condition
        • Switch case
        • Condition Node
      • In DataPrep
      • Properties
      • Workflow Applications
        • Workflow #1
        • Workflow #2
    • Getting Started
    • Language Basics
    • Types & Objects
      • Primitives
      • Objects
        • Instant
        • LocalDateTime
        • LocalDate
        • LocalTime
        • JsonNode
        • ObjectNode
        • File
        • SuiteTable
        • Duration
        • Period
      • Arrays & Maps
      • Row, Column, StringColumn
    • Utilities
      • Date & Time
        • InstantUtil
        • GeneralDateUtil
        • LocalDateTimeUtil
        • LocalDateUtil
        • LocalTimeUtil
        • Formatting
        • Timezones
      • Math
      • StrictMath
      • NumericUtil
      • DbUtil
      • DbExecutor
      • StateUtil
      • FileUtil
      • JsonUtil
      • HttpUtil
      • NodeInputReader
      • RandomUtil
      • HashingUtil
      • ShellUtil
      • CompressionUtil
      • Logging
    • Properties
    • Context and System
      • Context
      • System
    • Configurations
      • Workflow Configuration
    • Tutorial
    • Feedback
  • B2Data
    • Tutorials
      • Infor DataFabric to On-Premise Database Replication
      • API (DB replication, Email)
    • Workflow Settings
      • General Settings
      • Global/All Properties
      • Execution Configuration
        • General
        • Runtime
        • Compiler
        • Storage
        • Clean Up
      • Permissions
    • Nodes
      • Scheduler
    • Services Configuration
      • Microsoft Graph
Powered by GitBook
On this page

Was this helpful?

  1. Scripting
  2. Types & Objects
  3. Objects

Period

The Period class is designed to represent a time-based duration, typically measured in seconds and nanoseconds. It offers a range of static methods for creating durations based on days, hours, minutes, seconds, milliseconds, and nanoseconds. Additionally, it provides conversion methods to express the duration in various units, as well as the ability to calculate the duration between two temporal objects. This class is ideal for measuring time spans, tracking elapsed time, and performing time-based calculations in applications.

Static Methods

ofDays(days: Integer)

  • Obtains a Period representing a number of standard 24-hour days.

  • Example Usage:

    var daysPeriod = Period.ofDays(5);

ofMonths(months: Integer)

  • Obtains a Periodrepresenting a number of standard months.

  • Example Usage:

    var monthsPeriod = Period.ofMonths(12);

ofYears(years: Integer)

  • Obtains a Periodrepresenting a number of standard years.

  • Example Usage:

    var yearsPeriod = Period.ofYears(30);

ofWeeks(weeks: Long)

  • Obtains a Periodrepresenting a number of weeks.

  • Example Usage:

    var weeksPeriod = Period.ofWeeks(4);

parse(text: String)

  • Obtains a Periodfrom a text string such as P2Y3M4D.

  • Parses a textual representation of a period.

  • Example Usage:

    var parsedPeriod = Period.parse("P2Y3M4D");

between(startInclusive: LocalDate, endExclusive: LocalDate)

  • Obtains a Periodrepresenting the duration between two temporal objects.

  • Example Usage:

    var end = LocalDate.now(); // current date-time
    var start = end.minusDays(1); // current date-time minus 1 day
    var duration = Period.between(start, end); // period is 1 day
PreviousDurationNextArrays & Maps

Last updated 11 days ago

Was this helpful?