- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-20-2016 05:25 AM
Hi Experts,
I have a Date/Time field as below:
I only require Date to be fetched from this field using client script.
Could anyone pls help?
Thanks,
Rathika
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-20-2016 05:30 AM
My recommendation would be to parse the display value of the object. You should be able to do this with a clever split() method.
If that's not an option, use a GlideAjax operation to send the date time to the server, parse it there, convert it to a date object and send it back.
something like this. WARNING: Untested code!
var dateTimeStr = g_form.getValue('u_date_time');
var dateArr = dateTimeStr.split(' ');
var date = dateArr[0];
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-20-2016 05:29 AM
Hi Rathika,
You can use a javascript function called split().
Check out this link - JavaScript String split() Method
Thanks,
Nitin.
PS - Please mark Helpful, Like, or Correct Answer if applicable.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-20-2016 05:30 AM
My recommendation would be to parse the display value of the object. You should be able to do this with a clever split() method.
If that's not an option, use a GlideAjax operation to send the date time to the server, parse it there, convert it to a date object and send it back.
something like this. WARNING: Untested code!
var dateTimeStr = g_form.getValue('u_date_time');
var dateArr = dateTimeStr.split(' ');
var date = dateArr[0];
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-20-2016 05:30 AM
var datePart = g_form.getValue('dateField').split(' ')[0];
Should do the trick.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2016 01:47 AM
Hi All,
Thanks for the script.! That was perfect