apiverve_unixtimestamp 1.2.4 → 1.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fe5fd720934c38f65d0ea5b54a6d0a2db3ac4464ee14a178df1c7799860e1c3d
4
- data.tar.gz: a48110455773ae94278c32dc5f206ae5a81b2d7a4e13dc573e2352b54d28efe5
3
+ metadata.gz: b405d20c3f1b41e50b8dd4a6c168b467e91a0fcbcdc0e219b9af618edc5918a2
4
+ data.tar.gz: 5501d92c68d929187dcdf78ec5801da086a64725c0dc8eefa63b0ca41e9496fd
5
5
  SHA512:
6
- metadata.gz: 0e2209b8277cf8b5f5979103fd5d364357f38a8b6c3919985d26c21e6517b90359096639df17cc429ee820161d26ef81ea263fec5e82845220e6b947090c75db
7
- data.tar.gz: 0cded99125172fba45c666422c9048ee2a70922faf394b6a18791a4c1a70c7149706f773044d3c465e779cd5f75aeb89e5de9dbfc4b2eb9ba4c33d501e080ed4
6
+ metadata.gz: 4c634def815b01a77e05f9c4974a43c8ffd20a3f766e70f1d408fdc5930fc12a687344aaae77732ee6b9bb345325ae07d9aafd80823ecd29991b830e11791af2
7
+ data.tar.gz: 85b33dc20baa45d04551dd28d7765ee2b531479702bf3c1df8aa3f2fcc44c6db6065b736e7650aeff79083862659d74f917ef8cc07cbb02cf4df72724b214f1f
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Unix Timestamp Converter API - Ruby Gem
2
2
 
3
- Unix Timestamp Converter converts Unix timestamps into formatted dates and parses ISO 8601 strings back into epoch seconds. Responses break down dates into ISO 8601, RFC 2822, simple time strings, and individual calendar components like year, month, and hour.
3
+ Unix Timestamp Converter converts Unix timestamps into formatted dates and parses ISO 8601 strings back into epoch seconds. Responses break down dates into ISO 8601, RFC 2822, simple time strings, individual calendar components like year, month and hour, plus the day of the year. Paid plans add the ISO week, and an IANA timezone to also get the same moment in local time with its UTC offset, abbreviation and daylight saving flag.
4
4
 
5
5
  ## Installation
6
6
 
@@ -37,7 +37,8 @@ client = APIVerve::Unixtimestamp::Client.new(api_key: "YOUR_API_KEY")
37
37
  # Make a request
38
38
  response = client.execute({
39
39
  timestamp: "1609459200",
40
- format: "seconds"
40
+ format: "seconds",
41
+ timezone: "America/New_York"
41
42
  })
42
43
 
43
44
  # Print the response
@@ -49,7 +50,7 @@ puts response
49
50
 
50
51
  ```ruby
51
52
  begin
52
- response = client.execute({ timestamp: "1609459200", format: "seconds" })
53
+ response = client.execute({ timestamp: "1609459200", format: "seconds", timezone: "America/New_York" })
53
54
  puts response["data"]
54
55
  rescue APIVerve::Unixtimestamp::ValidationError => e
55
56
  puts "Validation error: #{e.errors.join(', ')}"
@@ -78,7 +79,7 @@ client = APIVerve::Unixtimestamp::Client.new(
78
79
  "data": {
79
80
  "timestamp": 1609459200,
80
81
  "timestamp_format": "seconds",
81
- "iso_8601": "2021-01-01T00:00:00Z",
82
+ "iso_8601": "2021-01-01T00:00:00.000Z",
82
83
  "rfc_2822": "Fri, 01 Jan 2021 00:00:00 GMT",
83
84
  "date": "1/1/2021",
84
85
  "time": "12:00:00 AM",
@@ -91,7 +92,28 @@ client = APIVerve::Unixtimestamp::Client.new(
91
92
  "minute": 0,
92
93
  "second": 0,
93
94
  "day_of_week": "Friday",
94
- "timezone": "UTC"
95
+ "timezone": "UTC",
96
+ "day_of_year": 1,
97
+ "iso_week": "2020-W53",
98
+ "local": {
99
+ "timezone": "America/New_York",
100
+ "iso_8601": "2020-12-31T19:00:00-05:00",
101
+ "date": "12/31/2020",
102
+ "time": "7:00:00 PM",
103
+ "year": 2020,
104
+ "month": 12,
105
+ "day": 31,
106
+ "hour": 19,
107
+ "minute": 0,
108
+ "second": 0,
109
+ "day_of_week": "Thursday",
110
+ "day_of_year": 366,
111
+ "iso_week": "2020-W53",
112
+ "utc_offset": "-05:00",
113
+ "utc_offset_seconds": -18000,
114
+ "abbreviation": "EST",
115
+ "is_dst": false
116
+ }
95
117
  }
96
118
  }
97
119
  ```
@@ -10,7 +10,7 @@ module APIVerve
10
10
  #
11
11
  # @example Basic usage
12
12
  # client = APIVerve::Unixtimestamp::Client.new(api_key: "your_api_key")
13
- # response = client.execute({ timestamp: "1609459200", format: "seconds" })
13
+ # response = client.execute({ timestamp: "1609459200", format: "seconds", timezone: "America/New_York" })
14
14
  # puts response
15
15
  #
16
16
  # @see https://apiverve.com/marketplace/unixtimestamp?utm_source=ruby&utm_medium=referral&utm_content=readme
@@ -19,7 +19,7 @@ module APIVerve
19
19
  DEFAULT_TIMEOUT = 30
20
20
 
21
21
  # Validation rules for parameters
22
- VALIDATION_RULES = { 'timestamp' => { type: 'string', required: true, format: 'timestamp' }, 'format' => { type: 'string', required: false } }
22
+ VALIDATION_RULES = { 'timestamp' => { type: 'string', required: true, format: 'timestamp' }, 'format' => { type: 'string', required: false }, 'timezone' => { type: 'string', required: false, format: 'timezone' } }
23
23
 
24
24
  # Format validation patterns
25
25
  FORMAT_PATTERNS = {
@@ -4,6 +4,6 @@ require_relative "apiverve_unixtimestamp/client"
4
4
 
5
5
  module APIVerve
6
6
  module Unixtimestamp
7
- VERSION = "1.2.4"
7
+ VERSION = "1.2.5"
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apiverve_unixtimestamp
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.4
4
+ version: 1.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - APIVerve
@@ -59,8 +59,10 @@ dependencies:
59
59
  version: '2.0'
60
60
  description: Unix Timestamp Converter converts Unix timestamps into formatted dates
61
61
  and parses ISO 8601 strings back into epoch seconds. Responses break down dates
62
- into ISO 8601, RFC 2822, simple time strings, and individual calendar components
63
- like year, month, and hour.
62
+ into ISO 8601, RFC 2822, simple time strings, individual calendar components like
63
+ year, month and hour, plus the day of the year. Paid plans add the ISO week, and
64
+ an IANA timezone to also get the same moment in local time with its UTC offset,
65
+ abbreviation and daylight saving flag.
64
66
  email:
65
67
  - hello@apiverve.com
66
68
  executables: []