Random Date

The $RDate function generates random dates. It accepts the following parameters:

  1. (optional) Format. String, the default value is 'DD.MM.YYYY'. See date and time formats for details.
  2. (optional) Low border. Date, the default value is '01.01.1970'.
  3. (optional) High border. Date, the default value is '31.12.2050'.

Notes:

  • Values for 2nd and 3d parameters must use the format specified by the first parameter.
  • Function call, local or global variable are acceptable as 2nd and 3d parameters.
  • The function fixes a few wrong values automatically: month to [1:12] range, day to [1:31] range, etc.

Implementation note: the engine ignores 'High border' value in case it is less than 'Low border'.

Examples

  1. $RDate() means random date between '01.01.1970' and '31.12.2050'.
  2. $RDate(YYYYMMDD,20000101,20101231) means random date between '01.01.2000' and '31.01.2010' with 'YYYYMMDD' format.