Random Timestamp (RandomTimestampGenerator)

The Random Timestamp generator generates random dates, times, and timestamps that fall within a specified range.

The Random Timestamp generator does not support linking or consistency. You cannot configure differential privacy.

The metadata object is populated from the TimestampRangeMetadata object, which includes:

  • For text columns, the format of the timestamp in the original data.

  • For integer columns, the unit to use for the value. The generator produces a Unix timestamp.

  • If the timestamp format includes dates, the minimum and maximum timestamps. Uses the format yyyy-MM-ddTHH:MM:SSZ.

  • If the timestamp format is time-only, the minimum and maximum timestamps. The date part of the timestamp is ignored. Uses the format yyyy-MM-ddTHH:MM:SSZ.

{
  "schema": "string",
  "table": "string",
  "column": "string",
  "dataType": "string",  //MongoDB only
  "metadata": {
    "presetId": "string",
    "generatorId": "RandomTimestampGenerator",
    "dateTimeFormat": "enum",  //For text columns
    "unixTimestampFormat": "enum"  // For integer columns
    "minDate": "timestamp",  //For formats with dates
    "maxDate": "timestamp",  //For formats with dates
    "minTime": "timestamp"   //For time-only formats
    "maxTime": "timestamp"   //For time-only formats,
    "encryptionProcessor": "x-on", //To use configured Structural data encryption
    "customValueProcessor": "string"  //If custom value processor is applied
  }
}

Example replacements

In the following example replacement for the Random Timestamp generator, the source column is a text column. The format for the timestamps in the original data is yyyy-MM-dd HH:mm:ss. The timestamps occur between November 20, 2022 at 8:57:14 PM and November 21, 2022 at 8:57:14 PM.

{
  "name": "start",
  "schema": "public",
  "table": "users",
  "links": [
    {
      "column": "start",
      "table": "users",
      "schema": "public",
      "metadata": {
        "presetId": "RandomTimestampGenerator",
        "generatorId": "RandomTimestampGenerator",
        "dateTimeFormat": "yyyy-MM-dd HH:mm:ss",
        "minDate": "2022-11-20T20:57:14Z",
        "maxDate": "2022-11-21T20:57:14Z"
      }
    }
  ]
}

The following example uses the same range as the previous example, but the column is an integer column. The generator is configured to produce Unix timestamps in seconds.

{
  "name": "start",
  "schema": "public",
  "table": "users",
  "links": [
    {
      "column": "start",
      "table": "users",
      "schema": "public",
      "metadata": {
        "presetId": "RandomTimestampGenerator",
        "generatorId": "RandomTimestampGenerator",
        "unixTimestampFormat": "Seconds",
        "minDate": "2022-11-20T20:57:14Z",
        "maxDate": "2022-11-21T20:57:14Z"
      }
    }
  ]
}

The following example generates time-only values between 8:00 AM and 5:00 PM. The date part of the minTime and maxTime values is ignored.

{
  "name": "start",
  "schema": "public",
  "table": "users",
  "links": [
    {
      "column": "start",
      "table": "users",
      "schema": "public",
      "metadata": {
        "presetId": "RandomTimestampGenerator",
        "generatorId": "RandomTimestampGenerator",
        "dateTimeFormat": "HH:mm:ss",
        "minTime": "2022-11-20T08:00:00Z",
        "maxTime": "2022-11-20T17:00:00Z"
      }
    }
  ]
}

Last updated