Skip to content

Commit 10ce92d

Browse files
Extract and Convert Date in a Text or String to GlideDate Format
1 parent 5b7dbe6 commit 10ce92d

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

GlideDate/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Extract and Convert Date in a Text or String to GlideDate Format
2+
3+
## Use Case / Requirement
4+
This script extracts a date from a string formatted as "20 Nov 2020" and converts it into the GlideDate format used in ServiceNow. This is particularly useful for maintaining accurate records of software patches and updates.
5+
6+
## Solution
7+
The solution utilizes the `GlideDate` object to parse the date from the string and format it appropriately. The script extracts the day, month, and year, then constructs a formatted date string.
8+
9+
## Example Input and Output
10+
- **Input Format**: Example string containing patch information
11+
- Example: `"kernel-headers-2.6.32-754.35.1.el6.x86_64 20 Nov 2020"`
12+
- **Output Format**:
13+
- GlideDate format: `2020-11-20` (if displayed in `yyyy-MM-dd` format)
14+
15+
## Code Snippet
16+
Please find the attached javascript file to know how to implement it. Thank you!

0 commit comments

Comments
 (0)