The DateTime data generator is a versatile data generator that has multiple date-time options and several format choices.

Date-time options

The Date-time option property controls what date-time will be returned by the data generator. 

Random

Select the Random value to return a date-time between the Min and Max value properties. For example, a date-time between 1/1/2020 and 1/1/2030

Current date-time

The following values return the current date-time

  • Select the Current local date-time value to return the current date-time in the local timezone.
  • Select the Current UTC date-time value to return the current date-time in the UTC (GMT) timezone.

To return a date-time in the future (or the past):

  1. Set the Date/time offset unit property for the desired unit to offset the time. 

    Available units

    The available offset units are: Day, Month, Year, Hour, Minute, Second

  2. Set the Day/time offset property to return the number of units in the future or past from the current date and time.

Sequential

Generate sequential date/time starting from the Min value. 

Reaching max value

  • When Max is reached, the next value = Min
  • For unique values, set Max higher than the total iterations needed
  1. Set the Type property (a) to Date/Time
  2. The Date-time type property (b) to Auto-Increment
  3. Set the Min (c) and Max (d) values to define the start and end range
  4. Set the Day/time part to increment (e) property to control the increment.

    Available increments

    The available parts are Day, Month, Year, Hour, Minute, and Second.

  5. Set the Auto-increment scope (f) property:
    • All-VUs  to keep a global auto-increment counter shared by all VUs

      Persist between tests

      Set the Persist auto-increment value across test runs? property to continue the auto-increment value from the previous test.

    • Per-VU  to keep a separate auto-increment counter for every VU

      Reset value on every iteration

      Set the Reset value on every iteration property to reset the value of the data generator to the Min value on every iteration.

Date-time format

The generated date-time is formatted before it is returned. The Date-time format property controls the formatting options.

Formatted

Select the Formatted value to format the returned date-time according to the Format string property.

Format string

The format string can either be:

  • Standard date-time formats are described here.
  • Custom date-time formats are described here.

Unix time

Select the following values to format the returned date-time in Unix (Epoch) time. 

  • Select the Unix time in milliseconds value to return the number of milliseconds between the returned date-time and January 1, 1970.
  • Select the Unix time in seconds value to return the number of seconds between the returned date-time and January 1, 1970.

  • No labels