Description:
[web] fix time.new, time.now to use gmtime
git-svn-id: http://theory.cpe.ku.ac.th/grader/web/trunk@249 6386c4cd-e34a-4fa8-8920-d93eb39b512e
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r121:00c0c912cae9 - - 3 files changed: 3 inserted, 3 deleted
@@ -38,13 +38,13 | |||||
|
38 | @submission.user = user |
|
38 | @submission.user = user |
|
39 | @submission.language_id = 0 |
|
39 | @submission.language_id = 0 |
|
40 | if params['file']!='' |
|
40 | if params['file']!='' |
|
41 | @submission.source = params['file'].read |
|
41 | @submission.source = params['file'].read |
|
42 | @submission.source_filename = params['file'].original_filename |
|
42 | @submission.source_filename = params['file'].original_filename |
|
43 | end |
|
43 | end |
|
44 | - @submission.submitted_at = Time.new |
|
44 | + @submission.submitted_at = Time.new.gmtime |
|
45 |
|
45 | ||
|
46 | if user.site!=nil and user.site.finished? |
|
46 | if user.site!=nil and user.site.finished? |
|
47 | @submission.errors.add_to_base "The contest is over." |
|
47 | @submission.errors.add_to_base "The contest is over." |
|
48 | prepare_list_information |
|
48 | prepare_list_information |
|
49 | render :action => 'list' and return |
|
49 | render :action => 'list' and return |
|
50 | end |
|
50 | end |
@@ -15,13 +15,13 | |||||
|
15 | end |
|
15 | end |
|
16 |
|
16 | ||
|
17 | contest_time = Configuration['contest.time_limit'] |
|
17 | contest_time = Configuration['contest.time_limit'] |
|
18 | if tmatch = /(\d+):(\d+)/.match(contest_time) |
|
18 | if tmatch = /(\d+):(\d+)/.match(contest_time) |
|
19 | h = tmatch[1].to_i |
|
19 | h = tmatch[1].to_i |
|
20 | m = tmatch[2].to_i |
|
20 | m = tmatch[2].to_i |
|
21 | - return Time.now > (self.start_time + h.hour + m.minute) |
|
21 | + return Time.now.gmtime > (self.start_time + h.hour + m.minute) |
|
22 | else |
|
22 | else |
|
23 | false |
|
23 | false |
|
24 | end |
|
24 | end |
|
25 | end |
|
25 | end |
|
26 |
|
26 | ||
|
27 | end |
|
27 | end |
@@ -79,13 +79,13 | |||||
|
79 | end |
|
79 | end |
|
80 | if params[:additional_file]!=nil and params[:additional_file]!="" |
|
80 | if params[:additional_file]!=nil and params[:additional_file]!="" |
|
81 | save_additional_file(params[:additional_file], |
|
81 | save_additional_file(params[:additional_file], |
|
82 | "#{test_request.input_file_name}.files") |
|
82 | "#{test_request.input_file_name}.files") |
|
83 | end |
|
83 | end |
|
84 | end |
|
84 | end |
|
85 | - test_request.submitted_at = Time.new |
|
85 | + test_request.submitted_at = Time.new.gmtime |
|
86 | test_request.status_inqueue |
|
86 | test_request.status_inqueue |
|
87 | test_request |
|
87 | test_request |
|
88 | end |
|
88 | end |
|
89 |
|
89 | ||
|
90 | protected |
|
90 | protected |
|
91 |
|
91 |
You need to be logged in to leave comments.
Login now