Current time value
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2023 06:09 AM
I created table on a widget that has columns. One of the column fields is a date/time field.
Currently the date shows up correct but it's not pulling in the current time value. How do I also add the current time into the date field value in GMT stored in 'u_arrival_date'?
Currently in my widget to pull the date I coded:
c.form.u_arrival_date = new Date();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2023 06:18 AM
Hi @asher14
Try this
c.form.u_arrival_date = new GlideDateTime();
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2023 07:21 AM
Sorry to missing info. I am working in the client controller and GlideDateTime() doesn't work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2023 06:25 AM - edited 07-07-2023 06:27 AM
Try
c.form.u_arrival_date=new GlideDateTime().getDisplayValue()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2023 07:20 AM
Sorry to missing info. I am working in the client controller and GlideDateTime() doesnt work