Skip to content

Commit 4c7c178

Browse files
shmuel44ShirleyDenkbergJasBeilin
authored
GetTime (demisto#39311)
* fix context output description * readme * RN * readme * Apply suggestions from code review Co-authored-by: ShirleyDenkberg <[email protected]> * Update Packs/CommonScripts/Scripts/GetTime/README.md Co-authored-by: Jasmine Beilin <[email protected]> * CR * Trigger Build --------- Co-authored-by: ShirleyDenkberg <[email protected]> Co-authored-by: Jasmine Beilin <[email protected]>
1 parent 864cc83 commit 4c7c178

File tree

4 files changed

+37
-23
lines changed

4 files changed

+37
-23
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
#### Scripts
3+
4+
##### GetTime
5+
6+
Documentation and metadata improvements.

Packs/CommonScripts/Scripts/GetTime/GetTime.yml

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,32 +12,34 @@ enabled: true
1212
args:
1313
- name: date
1414
default: true
15-
description: The date to use in the object
15+
description: The date to use in the object.
1616
- name: dateFormat
1717
description: |-
18-
The date format for the result, can be ISO/GMT/UTC/Locale/Date/Year/Month/Day/DayInWeek/Hours.
19-
Note that the response will start from 0, E.G. if the current month is October
18+
The date format for the result. Can be ISO/GMT/UTC/Locale/Date/Year/Month/Day/DayInWeek/Hours.
19+
Note that the response will start from 0. For example, if the current month is October
2020
(the 10th month) the result will be 9.
2121
Note:
22-
In XSOAR versions 6.11.0 or later, or 8.1.0 or later, the time format returned when UTC or GMT is given has changed.
23-
Instead of 'Wed Jan 18 2023 12:59:12 GMT+0000 (UTC)', The output will be 'Wed, 18 Jan 2023 15:04:41 GMT'.
22+
In Cortex XSOAR versions 6.11 or later, or 8.1.0 or later, the time format returned when UTC or GMT is given has changed.
23+
Instead of 'Wed Jan 18 2023 12:59:12 GMT+0000 (UTC)', The output will be 'Wed, 18 Jan 2023 15:59:12 GMT'.
2424
- name: contextKey
25-
description: prefix the keys in the context for the results
25+
description: Prefix the keys in the context for the results.
2626
- name: minutesAgo
27-
description: Will subtract minutesAgo minutes from current time
27+
description: Will subtract minutesAgo minutes from current time.
2828
- name: hoursAgo
29-
description: Will subtract hoursAgo hours from current time
29+
description: Will subtract hoursAgo hours from current time.
3030
- name: daysAgo
31-
description: Will subtract daysAgo days from current time
31+
description: Will subtract daysAgo days from current time.
3232
- name: monthsAgo
33-
description: Will subtract monthsAgo months from current time
33+
description: Will subtract monthsAgo months from current time.
3434
- name: yearsAgo
35-
description: Will subtract yearsAgo years from current time
35+
description: Will subtract yearsAgo years from current time.
3636
outputs:
3737
- contextPath: TimeNowUnix
38-
description: number of milliseconds since 1970/01/01
38+
description: Number of milliseconds since 1970/01/01.
39+
type: Number
3940
- contextPath: TimeNow
40-
description: current time in ISO format
41+
description: Current time.
42+
type: String
4143
scripttarget: 0
4244
tests:
4345
- GetTime-Test
Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,36 @@
1-
Retrieves the current date and time.
1+
Retrieves the current date and time.
2+
23

34
## Script Data
5+
46
---
57

68
| **Name** | **Description** |
79
| --- | --- |
810
| Script Type | javascript |
911
| Tags | Utility |
10-
12+
| Cortex XSOAR Version | 5.0.0 |
1113

1214
## Inputs
15+
1316
---
1417

1518
| **Argument Name** | **Description** |
1619
| --- | --- |
1720
| date | The date to use in the object. |
18-
| dateFormat | The date format for the result. Can be "ISO", "GMT", "UTC", "Locale", "Date", "Year", "Month", "Day", "DayInWeek", "Hours". |
19-
| contextKey | The prefix the keys in the context for the results. |
20-
| monthsAgo | Subtracts monthsAgo months from current time. |
21-
| minutesAgo | Subtracts minutesAgo minutes from current time. |
22-
| hoursAgo | Subtracts hoursAgo hours from current time. |
21+
| dateFormat | The date format for the result. Can be ISO/GMT/UTC/Locale/Date/Year/Month/Day/DayInWeek/Hours.<br/>Note that the response will start from 0. For example, if the current month is October<br/>\(the 10th month\) the result will be 9.<br/>Note:<br/>In Cortex XSOAR versions 6.11 or later, or 8.1.0 or later, the time format returned when UTC or GMT is given has changed.<br/>Instead of 'Wed Jan 18 2023 12:59:12 GMT\+0000 \(UTC\)', The output will be 'Wed, 18 Jan 2023 15:59:12 GMT'. |
22+
| contextKey | Prefix the keys in the context for the results. |
23+
| minutesAgo | Will subtract minutesAgo minutes from current time. |
24+
| hoursAgo | Will subtract hoursAgo hours from current time. |
25+
| daysAgo | Will subtract daysAgo days from current time. |
26+
| monthsAgo | Will subtract monthsAgo months from current time. |
27+
| yearsAgo | Will subtract yearsAgo years from current time. |
2328

2429
## Outputs
30+
2531
---
2632

2733
| **Path** | **Description** | **Type** |
2834
| --- | --- | --- |
29-
| TimeNowUnix | The number of milliseconds since 1970/01/01. | Unknown |
30-
| TimeNow | The current time in ISO format. | Unknown |
35+
| TimeNowUnix | Number of milliseconds since 1970/01/01. | Number |
36+
| TimeNow | Current time. | String |

Packs/CommonScripts/pack_metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "Common Scripts",
33
"description": "Frequently used scripts pack.",
44
"support": "xsoar",
5-
"currentVersion": "1.19.35",
5+
"currentVersion": "1.19.36",
66
"author": "Cortex XSOAR",
77
"url": "https://www.paloaltonetworks.com/cortex",
88
"email": "",

0 commit comments

Comments
 (0)