We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eb871f3 commit 8444328Copy full SHA for 8444328
DataFrame-Core.package/DataSeriesTime.class/class/randomDates..st
@@ -0,0 +1,15 @@
1
+instance creation
2
+randomDates: aNumber
3
+
4
+ | lo hi rand |
5
+ lo := 0.
6
+ hi := (DateAndTime now) asSeconds.
7
+ rand := Random new.
8
9
+ ^ self newFrom: (
10
+ (1 to: aNumber) collect: [ :each |
11
+ | seconds |
12
13
+ "A random integer between lo and hi"
14
+ seconds := (rand nextInt: (hi - lo)) + lo.
15
+ (DateAndTime fromSeconds: seconds) asString ]).
0 commit comments