Quantcast
Channel: Mockaroo Community Forum - Latest posts
Viewing all articles
Browse latest Browse all 2665

How to generate dates (in a data-set) excluding Sunday in each week

$
0
0

Could you possibly use the add days function if it's a Sunday, so Sundays always turn into Mondays for example?
if my_date.strftime("%A") == 'Sunday' then
(my_date + days(1)).strftime("%Y-%m-%d")

You could replace days(1) with days(random(1,6) for other days too.


Viewing all articles
Browse latest Browse all 2665

Trending Articles