How can I convert integer field into date and time field ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2018 07:01 AM
Hi All,
I have a integer field in staging table and i need convert it into date and time field after that i need to put that value in change form.
So how can I convert integer field into date and time field in SNOW ?
Any suggestions.
Regards,
Hemanth.
- Labels:
-
Change Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2018 09:29 AM
Hi,
Can you please elaborate your requirement. Do you want to change your integer value to date time value using some logic?
Thanks,
Prateek Gupta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2018 09:38 AM
Hi Prateek,
My requirement is for remedy integration , in inbound we have some date and time fields in SNOW to that they send value in integer format those values will be stored in staging table value from that table we have fetch values and put in our change tables for that we need to write a logic to put values in date and time field on change form.
Thanks,
Hemnath
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2018 09:41 AM
Hi Hemanth,
So here you want to parse your integer value to Date time value by using some logic.
For this please use transform map script. Use GlideDateTime class to create the Date time object. Then save that value in your change table field.
Hope this answers your question.
Thanks,
Prateek Gupta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2018 09:41 AM
You can use javascript date method to covert date stored as milliseconds into date. where 100000000000 is milliseconds from January 1, 1970.
var d = new Date(100000000000);
document.getElementById("demo").innerHTML = d;