Click here to Skip to main content
15,878,430 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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 ...
Posted
Updated 18-Jul-13 19:20pm
v2
Comments
Sudhakar Shinde 19-Jul-13 1:36am    
What is that you tried? Tags selected are VB and JAVA.. Do you want to code in VB or java or both?
Nawab Ahmad 19-Jul-13 2:11am    
I have designed the processor(in java) which use to distribute the data between the given period of time and i am calling that servlet using vb 6.0.
H.Brydon 19-Jul-13 1:50am    
I'd also recommend against use of that timestamp format. If it is up to you, a better choice is IS 8601 ( https://en.wikipedia.org/wiki/ISO_8601 ) which is essentially yyyy-mm-dd or similar, which will cause less confusion in an international context.

VB
req.Open "GET", "http://10.0.0.23/avasarala/process.htm?startingDate=" & starting_date & "&endingDate=" & ending_date, False 
 
Share this answer
 
Comments
Prasad Khandekar 19-Jul-13 11:59am    
My 5+.
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.
Java
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,
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900