mardi 19 juillet 2022

Choosing a date randomly in a period?

I want to randomly choose a date from 2021/1/1 to 2021/12/31, the process might include as follows:

  1. generate a date list from 2021/1/1 to 2021/12/31, totally 365 elements;
  2. randomly choose a date from the list.

Thanks!




Aucun commentaire:

Enregistrer un commentaire