Ask a Question

How to covert milliseconds to UTF date format to verify from DB

Occasional Visitor

How to covert milliseconds to UTF date format to verify from DB

When I send request I am getting response in milliseconds [1576522684000], how can I covert it to UTF date format 2019-12-16-13:58:06.070000 to validate my request and DB response. Thanks in advance.

Frequent Contributor

You can search google for how to do this. If you want to do the conversion with a Groovy script, then here are the keywords I would use - "java convert milliseconds to utc date". You can try using groovy instead of java also, but java will give more results. We can use java libraries inside our groovy scripts.

Similarly, if you wanted to do the conversion with sql instead, you can search for "sql convert milliseconds to utc date". You can also mention the dialect of sql you are using such as sql server, mysql etc.

Here are all the java based google search results from stackoverflow:

good luck!

SmartBear Alumni (Retired)

Thanks for your help, @rajs2020!


@ramzsvs, did this suggestion help? Please let us know if you are still looking for the solution.

Tanya Yatskovskaya
SmartBear Community and Education Manager

Hey @ramzsvs

Sorry, i only just noticed this ticket, f youre still struggling, try this

def milval=testCase.getPropertyValue("valuepropname").toLong new Date(milval).format("yyyy-MM-dd'T'Hh:mm:ss.SSS'Z'")



if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
Showing results for 
Search instead for 
Did you mean: