Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

GENERATE AUTOMATIC DATE

Status
Not open for further replies.

crdamsel

Programmer
Aug 7, 2013
33
US
CAN SOMEONE HELP ME CREATE A DATE FIELD IN A WEB PAGE THAT AUTOMATICALLY UPDATES EVERY 2 WEEKS? FOR INSTANCE, WHEN THE WEB PAGE IS ACCESSED, IT WILL SHOW WHAT WAS THE ORIGINAL DATE OF 08/12/2016 (NOT NECESSARILY IN THIS FORMAT) TO BE 08/26/2016 BUT ON OR AFTER 08/26/2016, THE DATE CHANGES TO 09/09/2016. THIS CAN BE DONE IN VB OR JAVASCRIPT. ANY TIPS OR SUGGESTIONS ARE APPRECIATED.
 
VBScript will only run in Internet Explorer, so you might want to ask in forum216. You might also want to sprinkle in a few lowercase characters in your next post, since uppercase tends to mean shouting, and is considered bad etiquette.
 
ACTUALLY VB DOES WORK IN OTHER BROWSERS BESIDES INTERNET EXPLORER
APPRECIATE YOUR RESPONSE.
 
>ACTUALLY VB DOES WORK IN OTHER BROWSERS BESIDES INTERNET EXPLORER
Ok, I'm interested. Name one please. Because I'm aware of only one that supports vbscript natively, and that is IE.
 
>Ok, I'm interested

Me too. Of course we're thinking about client side. Maybe the OP is referring to server side ASP.



 
vb works with chrome and firefox as well as i.e.
 
>vb works with chrome and firefox as well as i.e

So, your corporate websites are therefore ASP-based; it isn't your browser running the VBscript, it is the server. You might like to visit forum333 for info on this.

Here's the basic calculation that meets the requirements you outlined in your first post, assuming you know and can retrieve the original date (startdate) and the current date (currentdate):

Code:
[blue]    Dim change, displaydate
    change = DateDiff("ww", startdate, currentdate)
    displaydate = DateAdd("ww", 2 * (change \ 2) + 2, startdate)
[/blue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top