vbscript add day of week

Posted on 2006-05-26
Last Modified: 2012-05-05
I need to bug fix an asp page quickly.  I have a variable that is set as follows (hard coded to explain)

strDate = 27/05/2006

The following routine adding in strDate.........

<%=MediumDate2(DateAdd("d", intdaysno, strDate))%>



I need the output to be

Sat 27-May
Question by:EugeneC
    LVL 22

    Expert Comment

    by:Ivo Stoykov
    Hello EugeneC,

    > MediumDate2
    you have to code it into the function. Without year you cannot get the day...



    Author Comment

    Example please?
    LVL 19

    Expert Comment

    I don't know what you are doing in your function but you need to format your date..

    For example:

    FormatDateTime(strDate, 1) would return:

    Saturday May 27, 2006

    LVL 6

    Accepted Solution

    Eugene C,

    If you want it exactly like the Sat 27-May you will need to manually build

    strNewDate = DateAdd("d", intdaysno, strDate)
    strWeekdayName = WeekdayName(Weekday(strNewDate), true)
    strMonthName = MonthName(month(strNewDate), true)
    strDay = Day(strNewDate)

    Response.Write strWeekdayName & " " & strDay & "-" & strMonthName


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Suggested Solutions

    I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
    This demonstration started out as a follow up to some recently posted questions on the subject of logging in: and…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now