Click here to Skip to main content
12,453,106 members (56,118 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: VB Java
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 18-Jul-13 18:29pm
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?
nawabahmad 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.
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

req.Open "GET", "http://10.0.0.23/avasarala/process.htm?startingDate=" & starting_date & "&endingDate=" & ending_date, False 
  Permalink  
Comments
Prasad Khandekar 19-Jul-13 11:59am
   
My 5+.
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

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,
  Permalink  

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160826.1 | Last Updated 19 Jul 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100