Current time value

asher14
Tera Contributor

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();

 

 

 

16 REPLIES 16

Voona Rohila
Kilo Patron
Kilo Patron

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

Sorry to missing info. I am working in the client controller and GlideDateTime() doesn't work.

Upender Kumar
Mega Sage

Try

 

c.form.u_arrival_date=new GlideDateTime().getDisplayValue()

UpenderKumar_0-1688736414662.png

 

 

Sorry to missing info. I am working in the client controller and GlideDateTime() doesnt work