troubleshooting Question

convert C# code to java

Avatar of satmisha
satmishaFlag for India asked on
5 Comments1 Solution115 ViewsLast Modified:
Hi Team,

I am newbie here and stuck on quite small problem where there is a requirement to convert c# code to the java code.
This c# code works fine but I need to use this is java where it doesn't work. Please help

TimeSpan time = new TimeSpan(2, 0, 0, 0);
TimeSpan endtime = new TimeSpan(2, 3, 0, 0);
string start_date = DateTime.Now.Add(time).ToString("yyyy-MM-ddTHH:mm:ss", CultureInfo.InvariantCulture);
String end_date = DateTime.Now.Add(endtime).ToString("yyyy-MM-ddTHH:mm:ss", CultureInfo.InvariantCulture);
String payload = "{\"end_date\": \""+end_date+"\",\"start_date\": \""+start_date+"\"}";

Looking forward to hearing from you experts.

Information Technology Specialist

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros