?
Solved

ASP.Net Date Format

Posted on 2013-05-22
3
Medium Priority
?
304 Views
Last Modified: 2013-05-23
Hello Experts
Can someone please help with a simple code snippet to return the following

Input Param: Dec-15
Output Param: 12-20015

 d = "Jan-15"
 Public Shared Function GetExpiryDate(ByVal d As String) As String
        Dim DateString = d.Split("-")        
	Dim RetVal As String = ""

        'Sort out the month part


        'Sort out the rest of the string

        'RetVal = "01-2015"
        Return RetVal

    End Function

Open in new window

0
Comment
Question by:newbie27
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 44

Accepted Solution

by:
Arthur_Wood earned 2000 total points
ID: 39188521
Dim DateString as String[] = d.Split("-")        
      Dim RetVal As String = ""

        'Sort out the month part
         Select Case
                  Case "Jan"
                     RetVal = "01"
                   Case "Feb"
                      RetVal = "02"
                  Case "Mar"  
                       RetVal = "03"
                  Case "Apr"
                       RetVal = "04"
                  Case "May"
                        RetVal = "05"
                  Case "Jun"
                        RetVal = "06"
                  Case "Jul"
                     RetVal = "07"
                   Case "Aug"
                      RetVal = "08"
                  Case "Sep"  
                       RetVal = "09"
                  Case "Oct"
                       RetVal = "10"
                  Case "Nov"
                        RetVal = "11"
                  Case "Dec"
                        RetVal = "12"
          End Select

        'Sort out the rest of the string
          RetVal = RetVal + "20" + DateString[1]
        'RetVal = "01-2015"
        Return RetVal
0
 
LVL 8

Author Closing Comment

by:newbie27
ID: 39190365
Thanks
0
 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 39190398
Glad to be of assistance

AW
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses

741 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