Solved

ASP.Net Date Format

Posted on 2013-05-22
3
302 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 500 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
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.
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

726 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