We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6c2f863 commit ccdec6dCopy full SHA for ccdec6d
GlideDateTime/Convert date format/readme.md
@@ -0,0 +1,9 @@
1
+# Convert date format
2
+
3
+**Use-case / Requirement :**
4
+Convert date from one format to another format
5
+For example from dd-mm-yyyy to yyyy-mm-dd or yyyy/mm/dd etc
6
7
+**Solution :**
8
+Use GlideDate object and getByFormat method for conversion.
9
+Check the script.js file to find the code
GlideDateTime/Convert date format/script.js
@@ -0,0 +1,6 @@
+var gd = new GlideDate(); //Intitialize GlideDate object
+gd.setValue('2021-13-10'); //you can pass date for which you need conversion
+//Now you can choose the format as required. Below are few examples
+gs.info(gd.getByFormat("dd-MM-yyyy"));
+gs.info(gd.getByFormat("yyyy/MM/dd"));
+gs.info(gd.getByFormat("dd/MM/yyyy"));
0 commit comments