DateTime

DateTime

DateTime generator. You have to define a start and end date. Either by specifying named references to foreign sources of date values (id="startDateRef", id="endDateRef", id="historicalStartDateRef", id="historicalEndDateRef") or specifying static ranges with: ['startDate', 'endDate'] and optional, if 'historicalTimeIDsCount' !=0, additionally with ['startDate', 'endDate']

Attributes
Name Description Required Min Max Allowed Values
name (Class)Name of this element. Used to identify plugin Class. Full name is required. Example: com.en.myPluginPackage.myPuginClass no 0 1
id Identification String of this element. May be used to uniquely identify a field within the children of an Element. no 0 1
Nodes
Name Description Required Min Max Allowed Values
disableRng Content type: Boolean
If set to true, instead of choosing a random date within the date range, use the the current row id as position marker to traverse the date range from start to end.
Default: false
no 0 1
  • true
  • false
  • 0
  • 1
endDate Content type: Date or property
End of time interval from which values are generated. Expecting either a human readable time format or properties. Default format: yyyy-MM-dd HH:mm:ss Examples: 2013-12-31 23:45:59 or ${someUserDefinedProperty}
no 0 1
historicalEndDate Content type: Date or property
Sets a separate date range in case your historical range (range [0,1[ or in case 'historicalTimeIDsCount' is set [0,historicalTimeIDsCount[) differs from the normal range ([startDate, endDate]). The normal range will be used for the update parts of a table in that case.End of time interval from which values are generated. Expecting either a human readable time format or properties. Default format: yyyy-MM-dd HH:mm:ss Examples: 2013-12-31 23:45:59 or ${someUserDefinedProperty}
no 0 1
startDate Content type: Date or property
Begin of time interval from which values are generated. Expecting either a human readable time format or properties. Default format: yyyy-MM-dd HH:mm:ss Examples: 2013-12-31 23:45:59 or ${someUserDefinedProperty}
no 0 1
historicalStartDate Content type: Date or property
Sets a separate date range in case your historical range (range [0,1[ or in case 'historicalTimeIDsCount' is set [0,historicalTimeIDsCount[) differs from the normal range ([startDate, endDate]). The normal range will be used for the update parts of a table in that case.Begin of time interval from which values are generated. Expecting either a human readable time format or properties. Default format: yyyy-MM-dd HH:mm:ss Examples: 2013-12-31 23:45:59 or ${someUserDefinedProperty}
no 0 1
inputFormat Content type: String
Date or time input format for 'startDate', 'endDate', 'historicalStartDate' and 'historicalEndDate'. Default format: yyyy-MM-dd HH:mm:ss. Format specification: http://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html
no 0 1
historicalTimeIDsCount Content type: Integer
Number of timeID's treated logically as 'historical'. Logically, historical timeIDs can have a different date/time range than 'normal' timeID's. For historical timeIDs the date/time range: [historicalStartDate, historicalEndDate] is used
Default: 1
no 0 1
reference reference. Possible references are: id="startDateRef", id="endDateRef", id="historicalStartDateRef", id="historicalEndDateRef no 0 2
useFixedStepSize Content type: Boolean
If set to false, each date_n will be computed with: date_n = date_n-1 + random. If set to true, each date will have a distance of [startDate, endDate] / numberOfRows to its next date.
Default: false
no 0 1
  • true
  • false
  • 0
  • 1
outputFormat Content type: String
Date or time output format. Default format: yyyy-MM-dd HH:mm:ss. Format specification: http://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html
no 0 1

Examples

  1. ISO Date in Time Period

    Generates random ISO dates in the given time period.

    Schema config for ISO Date in Time Period
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <!--
    /*******************************************************************************
    * Copyright (c) 2013, bankmark and/or its affiliates. All rights reserved.
    * bankmark UG PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
    ******************************************************************************/
    --><schema xmlns:doc="http://bankmark.de/pdgf/doc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="demo" xsi:noNamespaceSchemaLocation="structure/pdgfSchema.xsd">
      <!-- All data is derived from this starting seed.
           If this seed is the same, the generated data will the same on each
           computer/node/platform.
           Change this seed to generate a different data set.-->
      <seed>1234567890L</seed>
    
      <rng name="PdgfDefaultRandom"/>
    
      <!--Default Scale factor for all tables -->
      <property name="SF" type="double">1</property>
    
      <table name="DATE_TIME">
        <!-- if tables should scale with -SF command line argument.
             Specify your scaling formula here: -->
        <size>10 * ${SF}</size>
    
        <!--ISO Date in Time Period-->
          <!--Generates random ISO dates in the given time period.-->
          <field name="iso_date_period" size="" type="DATE">
            <gen_DateTime>
              <outputFormat>yyyy-MM-dd</outputFormat>
              <inputFormat>yyyy-MM-dd</inputFormat>
              <startDate>1979-12-01</startDate>
              <endDate>1980-01-31</endDate>
            </gen_DateTime>
          </field>
          </table>
    </schema>
    
    Output for ISO Date in Time Period
    1980-01-12
    1979-12-02
    1980-01-25
    1979-12-23
    1979-12-12
    1980-01-12
    1980-01-04
    1979-12-23
    1980-01-12
    1979-12-23
  2. ISO Date

    Generates random ISO dates that are at least 6 days apart (days(startDate - endDate) / tableSize)

    Schema config for ISO Date
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <!--
    /*******************************************************************************
    * Copyright (c) 2013, bankmark and/or its affiliates. All rights reserved.
    * bankmark UG PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
    ******************************************************************************/
    --><schema xmlns:doc="http://bankmark.de/pdgf/doc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="demo" xsi:noNamespaceSchemaLocation="structure/pdgfSchema.xsd">
      <!-- All data is derived from this starting seed.
           If this seed is the same, the generated data will the same on each
           computer/node/platform.
           Change this seed to generate a different data set.-->
      <seed>1234567890L</seed>
    
      <rng name="PdgfDefaultRandom"/>
    
      <!--Default Scale factor for all tables -->
      <property name="SF" type="double">1</property>
    
      <table name="DATE_TIME">
        <!-- if tables should scale with -SF command line argument.
             Specify your scaling formula here: -->
        <size>10 * ${SF}</size>
    
        <!--ISO Date-->
          <!--Generates random ISO dates that are at least 6 days apart (days(startDate - endDate) / tableSize)-->
          <field name="iso_date_fixed_step" size="" type="DATE">
            <gen_DateTime>
              <outputFormat>yyyy-MM-dd</outputFormat>
              <inputFormat>yyyy-MM-dd</inputFormat>
              <startDate>1979-12-01</startDate>
              <endDate>1980-01-31</endDate>
              <useFixedStepSize>true</useFixedStepSize>
            </gen_DateTime>
          </field>
          </table>
    </schema>
    
    Output for ISO Date
    1980-01-12
    1980-01-12
    1979-12-19
    1980-01-12
    1979-12-31
    1979-12-25
    1980-01-12
    1980-01-24
    1980-01-24
    1979-12-25
  3. Ordered ISO Date with Fixed Step Size

    Generates random ISO dates that are exactly 6 days apart (days(startDate - endDate) / tableSize)

    Schema config for Ordered ISO Date with Fixed Step Size
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <!--
    /*******************************************************************************
    * Copyright (c) 2013, bankmark and/or its affiliates. All rights reserved.
    * bankmark UG PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
    ******************************************************************************/
    --><schema xmlns:doc="http://bankmark.de/pdgf/doc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="demo" xsi:noNamespaceSchemaLocation="structure/pdgfSchema.xsd">
      <!-- All data is derived from this starting seed.
           If this seed is the same, the generated data will the same on each
           computer/node/platform.
           Change this seed to generate a different data set.-->
      <seed>1234567890L</seed>
    
      <rng name="PdgfDefaultRandom"/>
    
      <!--Default Scale factor for all tables -->
      <property name="SF" type="double">1</property>
    
      <table name="DATE_TIME">
        <!-- if tables should scale with -SF command line argument.
             Specify your scaling formula here: -->
        <size>10 * ${SF}</size>
    
        <!--Ordered ISO Date with Fixed Step Size-->
          <!--Generates random ISO dates that are exactly 6 days apart (days(startDate - endDate) / tableSize)-->
          <field name="iso_date_fixed_step_ordered" size="" type="DATE">
            <gen_DateTime>
              <outputFormat>yyyy-MM-dd</outputFormat>
              <inputFormat>yyyy-MM-dd</inputFormat>
              <startDate>1979-12-01</startDate>
              <endDate>1980-01-31</endDate>
              <useFixedStepSize>true</useFixedStepSize>
              <disableRng>true</disableRng>
            </gen_DateTime>
          </field>
          </table>
    </schema>
    
    Output for Ordered ISO Date with Fixed Step Size
    1979-12-01
    1979-12-07
    1979-12-13
    1979-12-19
    1979-12-25
    1979-12-31
    1980-01-06
    1980-01-12
    1980-01-18
    1980-01-24
2.7-83fb0 | 2020-04-22