Skip to content

R0mb0/List_out_dates_between_a_range_of_dates_classic_asp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

List out dates between a range of dates in Classic ASP

Codacy Badge

Maintenance Open Source Love svg3 MIT

Donate

List_out_dates.class.asp's avaible function

  • List out dates -> Public Function extractDates(start_date, end_date, selector, separator, month_name, abbreviate) - The function returns an array with all dates.
    • Where the selector could be:

      • "y" for Years
      • "m" for Months
      • "d" for Days
    • Where the separator could be:

      • An arbitrary symbol to separate date elements
    • Where the month_name coud be:

      • True for use MonthName function
      • False for don't use MonthName function
    • Where abbreviate could be:

      • True for abbreviate
      • False for don't abbreviate

How to use

From Test.asp

  1. Initialize the class

    <%@LANGUAGE="VBSCRIPT"%>
    <!--#include file="List_out_dates.class.asp"-->
     <%
       Dim dates
       Set dates = New  listOutDates
    
  2. Create a start date and a end date

     Dim start_date
     start_date = "07/02/2025 11:26:46" 
     Dim end_date
     end_date = "02/04/2027 15:06:30" 
    
  3. List out all dates from range

     Dim temp 
     For Each temp In dates.extractDates(start_date, end_date, "d", "/", True, False)
         Response.write(temp & "<br>")
     Next
    %>