Click here to Skip to main content
Rate this: bad
good
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 19:29pm
Edited 18-Jul-13 20:20pm
v2
Comments
Sudhakar Shinde at 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 at 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 at 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 at 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
0 OriginalGriff 390
1 Maciej Los 205
2 Peter Leow 140
3 Suvendu Shekhar Giri 134
4 Abhinav S 126
0 Sergey Alexandrovich Kryukov 9,623
1 OriginalGriff 8,895
2 Peter Leow 5,044
3 Kornfeld Eliyahu Peter 3,333
4 Maciej Los 2,561


Advertise | Privacy | Mobile
Web04 | 2.8.150327.1 | Last Updated 19 Jul 2013
Copyright © CodeProject, 1999-2015
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