Advertisement

05.10.2007 at 01:31PM PDT, ID: 22565193
[x]
Attachment Details

Date function in VB.NET

Asked by anagm in Microsoft Visual Basic.Net, .NET, VB Script

Tags: date, functions

Hello,

This is the vbscript show the date in the format "10-may-2008"

below is the vbscript
<script language="vbscript" for="VALID_DATE" event="onblur">
            dim tempDate1
            dim tempDate2
            dim monthsToAdd
            dim VTDate
            dim lstrDay
            dim lstrMonth
            dim lstrYear
            
            monthsToAdd = 12

            tempDate1 = Date()
            VTDate = dateAdd("m",monthsToAdd,tempDate1)
            lstrDay = Day(VTDate)
            lstrMonth = MonthName(Month(VTDate),true)
            lstrYear = Year(VTDate)

            'If the Day is less than 9 then we will add a 0 to it
            if lstrDay < 9 then
                  lstrDay = "0" & lstrDay
            end if

            VTDate = lstrDay & "-" & lstrMonth & "-" & lstrYear

            document.VALID_DATE.value = VTDate
            
</script>

I want to implement this in vb.net in my code-behind.  how should i convert this.
any help would be appreciated

thank you,
anagmStart Free Trial
 
 
[+][-]05.10.2007 at 01:40PM PDT, ID: 19068298

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.10.2007 at 02:16PM PDT, ID: 19068527

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft Visual Basic.Net, .NET, VB Script
Tags: date, functions
Sign Up Now!
Solution Provided By: jeebukarthikeyan
Participating Experts: 2
Solution Grade: A
 
 
[+][-]06.23.2007 at 06:42AM PDT, ID: 19347538

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]07.03.2007 at 03:59PM PDT, ID: 19415507

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]07.08.2007 at 06:02PM PDT, ID: 19442212

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32