123 Eng

Engineering the engineers™


Latest Jobs   Forum Map

 


Home
Source Codes
Engineering Colleges

Training  Reports
Seminar Reports
Placement Papers

Forums

   Computer Science / IT
   Electronics
   Electrical
   Mechanical
   Chemical
   Civil

   CAT / MBA

   GMAT / Foreign MBA
Latest Jobs

Engineering Jobs / Technical Jobs
Management Jobs

Sitemap
Terms of use

Displaying  Source Code(s)  
 

 
SwapDate Function

--------------------------------------------------------------------------------

Description : The SwapDate function changes a US format date into an Internationally formatted date and vice versa.

If the input is mm-dd-yy (US) it is converted to dd-mm-yy (Int'l). If the input is dd/mm/yy (Int'l) it is converted to mm-dd-yy (US). Acceptable date input can be in short format with either a two or four digit year: mm/dd/yy, mm/dd/yyyy, dd/mm/yy, dd/mm/yyyy. Worded dates are also acceptable as input: January 4, 2000 is changed to 4 January, 2000 and vice versa. 23rd August, 2000 would be changed to August 23rd, 2000.

<%
Private Function SwapDate(ByVal dateinput)
Dim strWorkingDate, tmpArray, assemblystring, del, i
strWorkingDate = dateinput
If InStr(strWorkingDate, "/") Then
tmpArray = Split( strWorkingDate, "/" ) : del = "/"
ElseIf InStr(strWorkingDate, "-") Then
tmpArray = Split( strWorkingDate, "-" ) : del = "-"
ElseIf InStr(strWorkingDate, " ") Then
tmpArray = Split( strWorkingDate, " " ) : del = " "
End If
For i = 0 To UBound(tmpArray)
tmpArray( i ) = Replace( tmparray( i ), ",", "" )
Next
assemblystring = tmpArray(1) & del & tmpArray(0)
If del = " " Then assemblystring = assemblystring & ","
assemblystring = assemblystring & del & tmpArray(2)
SwapDate = Trim( assemblystring )
End Function
%>

--------------------------------------------------------------------------------
 

 

Contribute content or training reports / feedback / Comments
job placement papers
All rights reserved © copyright 123ENG