Skip to content

Fix DateFormat in DateGen.java#2959

Merged
cgivre merged 2 commits intomasterfrom
pjfanning-patch-2
Mar 13, 2025
Merged

Fix DateFormat in DateGen.java#2959
cgivre merged 2 commits intomasterfrom
pjfanning-patch-2

Conversation

@pjfanning
Copy link
Copy Markdown
Member

@pjfanning pjfanning commented Oct 26, 2024

See #2958

long randTime = baseTime + baseTime + rand.nextInt(365) * ONE_DAY;
String str = fmt.format(new Date(randTime));
colWriter.setString(str);
final long randTime = baseTime + baseTime + rand.nextInt(365) * ONE_DAY;
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jnturton @cgivre this doesn't look right - baseTime is a big number but we add it twice so the result will be a very big number, a long way in the future.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pjfanning What if you just make it:

long randTime = baseTime + (rand.nextInt(365)* ONE_DAY)

@pjfanning pjfanning marked this pull request as draft October 27, 2024 00:49
long randTime = baseTime + baseTime + rand.nextInt(365) * ONE_DAY;
String str = fmt.format(new Date(randTime));
colWriter.setString(str);
final long randTime = baseTime + baseTime + rand.nextInt(365) * ONE_DAY;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pjfanning What if you just make it:

long randTime = baseTime + (rand.nextInt(365)* ONE_DAY)

@pjfanning pjfanning changed the title [DRAFT] Fix DateFormat in DateGen.java Fix DateFormat in DateGen.java Mar 13, 2025
@pjfanning pjfanning marked this pull request as ready for review March 13, 2025 13:44
@pjfanning
Copy link
Copy Markdown
Member Author

@cgivre I made the change to the randTime calculation

Copy link
Copy Markdown
Contributor

@cgivre cgivre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM +1

@cgivre cgivre merged commit d5358d6 into master Mar 13, 2025
13 checks passed
cgivre pushed a commit to cgivre/drill that referenced this pull request May 7, 2025
cgivre pushed a commit to cgivre/drill that referenced this pull request Mar 25, 2026
@pjfanning pjfanning deleted the pjfanning-patch-2 branch April 20, 2026 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants