- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-16-2022 12:25 PM - edited ‎10-16-2022 12:36 PM
Hi everyone, good afternoon!
I'm doing a glideRecord in the "sys_created_on" field in the "sc_req_item" table, but I only need to show: Year, Month and Day not Hours and Minutes (attached image).
Server:
var createdNew = todoLineRecordGr.getDisplayValue('sys_created_on');
data.createdNew = createdNew ? createdNew : "created new test";
HTML:
<h1>Created at: {{::data.createdNew}}</h1>
Obs.: There's glide_date_time, but I'm not understanding how to use!
Could anybody help me?
Tks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-16-2022 01:25 PM
Here is an example script:
var inc = new GlideRecord('incident');
inc.query();
if (inc.next()) {
var recDateTime = inc.sys_created_on.getDisplayValue();
gs.info("Inc: " + inc.number + " was created on " + recDateTime + ".");
var dateArray = recDateTime.split(" ");
gs.info("Date = " + dateArray[0] + ", time = " + dateArray[1] + ".");
}
and you can use:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-16-2022 01:25 PM
Here is an example script:
var inc = new GlideRecord('incident');
inc.query();
if (inc.next()) {
var recDateTime = inc.sys_created_on.getDisplayValue();
gs.info("Inc: " + inc.number + " was created on " + recDateTime + ".");
var dateArray = recDateTime.split(" ");
gs.info("Date = " + dateArray[0] + ", time = " + dateArray[1] + ".");
}
and you can use:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-16-2022 06:19 PM
Hi Bert!
Thanks for your support! Its working!!!
Att