How to convert array value into getbyformat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2024 05:12 PM
I have tried the below code and it's not working with the array. Showing as undefined
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2024 08:22 PM
Hi @Elakkiya A
getByFormat is a method from the GlideDate class. Your can refer to below
getByFormat(String format)
So the issue is that your date variable was not initiated as the GlideDate object.
Assume the dateTime[0] have a corrected date value, you can try this modification.
var date = new GlideDate(dateTime[0]);
Cheers,
Tai Vu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2024 09:01 PM
Hi @Maik Skoddow and @Tai Vu ,
I am trying the get the below field value which date and time, I need only the date from that and need to change the format to Tuesday 23 January 2024.
But the issue is when I give as getDate instead of getDisplayValue it's showing the previous date as 22 Jan.
Is there any other way I can convert this?