How to convert Date YYYY-MM-DD HH:MM:SS format to YYYY-MM-DD HH:MM format

Rajanmehta
Mega Guru

hello we are on Newyork.

I have a need to convert default time format  YYYY-MM-DD HH:MM:SS in Servicenow  to YYYY-MM-DD HH:MM format. (Excluding Seconds), because the tool, we are sending this accepts only  YYYY-MM-DD HH:MM format.

How can I do that? The final value should be of Date time only.

So 2020-02-20 23:09:18  should return 2020-02-20 23:09

Please advise.

Thanks,

Rajan 

 

1 ACCEPTED SOLUTION

JSON always send date as a string.  Which would make jacebeson's post below make sense that the API is looking for an integer.

View solution in original post

13 REPLIES 13

hi Brian,

I am using the API of the other system (Dynatrace), making POST call to create new downtime in that system so that Alerts are suppressed. 

Thanks,

Rajan 

Right but what format?  Like json?

Yes Brian,

In Jason format. Here is the example in POSTMAN.

find_real_file.png

JSON always send date as a string.  Which would make jacebeson's post below make sense that the API is looking for an integer.

I just had a chat with Dynatrace service Team, and they mentioned it is taking as String value. (Not integer) So I think I have to find out what is blocking me.

Thanks.

Rajan

 

find_real_file.png