useful_utilities 6.1.0 → 6.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/useful_utilities/time.rb +9 -0
- data/lib/useful_utilities/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f230670f167df46aa5c20e78e729c52a903628b7cdf1caf81b73f0d9e9351a8
|
4
|
+
data.tar.gz: 96d3147506f0cbefbda7ad1b675d76b63b3fefb1c6b776b840891cf2241e77aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e3a6ddc266ac23a5062e3fff7ec9ca73161730ee8cf3278214ca820d0554fb6bfb238915704f499c561223eb3e995c184bbe5e1752bc678c693c970c4e88afa
|
7
|
+
data.tar.gz: b6b6045ddf572ec6ed0f3b16bece856a61050c6dbe8f0be48d4079c0ca509b22f2ef42e510fd14dd7712f6c095672ea11bfcafe25d41f893afd03cc95a8ff92b
|
@@ -123,6 +123,15 @@ module UsefulUtilities
|
|
123
123
|
time.to_time.to_i * MILLISECONDS_IN_SECOND
|
124
124
|
end
|
125
125
|
|
126
|
+
# @param timestamp [Integer] timestamp in milliseconds
|
127
|
+
# @return [Integer] timestamp in seconds
|
128
|
+
# @example
|
129
|
+
# timestamp #=> 1568629976000
|
130
|
+
# UsefulUtilities::Time.timestamp_to_seconds(timestamp) #=> 1568629976
|
131
|
+
def timestamp_to_seconds(timestamp)
|
132
|
+
timestamp / MILLISECONDS_IN_SECOND
|
133
|
+
end
|
134
|
+
|
126
135
|
# @param end_time [Time] end time
|
127
136
|
# @param start_time [Time] start time
|
128
137
|
# @return [Integer] difference in hours
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: useful_utilities
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.1.
|
4
|
+
version: 6.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- OnApp Ltd.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-09-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -168,8 +168,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
168
168
|
- !ruby/object:Gem::Version
|
169
169
|
version: '0'
|
170
170
|
requirements: []
|
171
|
-
|
172
|
-
rubygems_version: 2.7.7
|
171
|
+
rubygems_version: 3.0.6
|
173
172
|
signing_key:
|
174
173
|
specification_version: 4
|
175
174
|
summary: Helpful methods for time, sizes, hashes etc.
|