Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
V
vest
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
rank
vest
Commits
bf3f111a
Commit
bf3f111a
authored
Jan 10, 2020
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
00605b63
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
process_time.py
moment/views/process_time.py
+4
-4
No files found.
moment/views/process_time.py
View file @
bf3f111a
...
...
@@ -94,8 +94,8 @@ def get_one_six_days_random_time(frmt='%Y-%m-%d %H:%M:%S', num_days=0, action_ty
nows
=
now
now
=
nows
+
datetime
.
timedelta
(
days
=
1
)
zeroday
=
str
(
datetime
.
datetime
(
now
.
year
,
now
.
month
,
now
.
day
,
10
,
0
,
0
))
lastday
=
str
(
datetime
.
datetime
(
now
.
year
,
now
.
month
,
now
.
day
,
2
3
,
0
,
0
))
zeroday
=
str
(
datetime
.
datetime
(
now
.
year
,
now
.
month
,
now
.
day
,
9
,
0
,
0
))
lastday
=
str
(
datetime
.
datetime
(
now
.
year
,
now
.
month
,
now
.
day
,
2
2
,
0
,
0
))
random_times
=
[
randomDate_six_one
(
zeroday
,
lastday
,
frmt
)
for
_
in
range
(
action_num
)]
have_sort_times
=
sorted
(
random_times
,
key
=
lambda
date
:
get_list
(
date
))
return
have_sort_times
...
...
@@ -112,8 +112,8 @@ def get_ten_last_days_random_time(num_days=None, frmt='%Y-%m-%d %H:%M:%S', conte
return
[]
##比较当前时间和最后一次创建时间的差
now
=
datetime
.
datetime
.
now
()
zeroday
=
datetime
.
datetime
(
now
.
year
,
now
.
month
,
now
.
day
,
10
,
0
,
0
)
lastday
=
datetime
.
datetime
(
now
.
year
,
now
.
month
,
now
.
day
,
2
3
,
0
,
0
)
zeroday
=
datetime
.
datetime
(
now
.
year
,
now
.
month
,
now
.
day
,
9
,
0
,
0
)
lastday
=
datetime
.
datetime
(
now
.
year
,
now
.
month
,
now
.
day
,
2
2
,
0
,
0
)
add_number
=
0
if
num_days
>
15
and
action_type
in
(
"follow"
):
action_num
=
random
.
randint
(
1
,
2
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment