gethour()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2024 10:15 AM
I am trying to create a script to get the month and the hour an incident was closed and enter it in different field. However, the hour is returing in a 12h format instead of 24h. Any Ideas on how to solve this? Here is my script:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2024 11:48 AM
Hi @ValeriaS ,
Can you please simply get the display value of the 'closed_at' and then split and take the 1st element of the array as shown below,
var closedAt = (new GlideDateTime(current.closed_at).getDisplayValue());
var closedTime = closedAt.split('<space>')[1];
Please check if it works for you.
If this address your question, please mark this response correct by clicking on Accept as Solution and/or Kudos.
You may mark this helpful as well if it helps you.
Thanks,
Animesh Das
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2024 12:05 AM
Hi @ValeriaS ,
If you got chance to check the solution and help you anyways, please mark this helpful or if it addresses your query correctly please Accept as Solution so that it helps the community for other users as well.
Otherwise share if you are facing any challenges there.
Thanks,
Animesh Das