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

Adding random days between two dates, without time

$
0
0

This happens to me all the time. If I set a start date in format yyyy-mm-dd, and then for the end date use a formula such as startDate + days(5), the result always includes time. Luckily, upon insert, mySQL truncates the values to just the date.

Here's an example:
https://mockaroo.com/54dc8f60

If you look at the schema, I set the date for effectiveOn and format it yyyy-mm-dd, then calculate confirmedOn by subtracting 10 days. If you hit preview, you can see the result, which always includes the time in the calculated field.


Viewing all articles
Browse latest Browse all 2665

Trending Articles