带有开始日期和结束日期的字符串 [英] string with starting date and ending date

查看:95
本文介绍了带有开始日期和结束日期的字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我使用一个字符串来处理数据,现在我想在该字符串上添加开始日期和结束日期。



代码:

req.OpenGET,http://10.0.0.23/avasarala/process.htm,错误



在这个字符串中我必须用dd-mm-yyyy的格式添加开始日期和结束日期



请help ...

Hi,

I am using one string to process the data ,now i want to add starting date and ending date on that string.

code:
req.Open "GET", "http://10.0.0.23/avasarala/process.htm", False

In this string i have to add the starting date and ending date with the formate of dd-mm-yyyy

Please help ...

推荐答案

req.Open "GET", "http://10.0.0.23/avasarala/process.htm?startingDate=" & starting_date & "&endingDate=" & ending_date, False 


Hello Ahmad,



Ryan已经给出了答案,他已经展示了如何使用XMLHttp对象在Visual Basic中完成它。请查看相应的java示例。

Hello Ahmad,

Ryan has already given the answer in which he has shown how it can be done in Visual Basic using XMLHttp object. Please see blow the equivalent java example.
DateFormat dtFmt = new SimpleDateFormat("dd-MM-yy");
String strQry = "?startingDate=" + dtFmt.format(dtFromDate) + "&endinDate=" + dtFmt.format(dtEnd);
URL aUrl = new URL("http://10.0.0.23/avasarala/process.htm" + strQry);
URLConnection uc = aUrl.openConnection();
BufferedReader in = new BufferedReader(new InputStreamReader(uc.getInputStream()));
String inputLine;
while ((inputLine = in.readLine()) != null) 
    System.out.println(inputLine);

in.close();



问候,


Regards,


这篇关于带有开始日期和结束日期的字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆