The goal of this post was to convert "1/4/12" (which represented April 1, 2012 in UK), into "4/1/12" (April 1, 2012 in US format). I need US format dates for my system.
I've used Skip's parser, and that works fine. There's a lot of commented out lines in my code, so please ignore them.
dateString = "4/5/12"
dateString2 = "12/5/12"
RegSource = "UK"
response.write "RegSource is" & RegSource & "<br>"
formattedDateString = ""
formattedDateString2 = ""...
OK, so what I wound up doing was this. I'm not sure how to parse by using the "/" characters as markers, so I used the following instead:
Dim aDate
Dim dateString, country
Dim switchedDay, switchedMonth, switchedYear
country = "UK"
document.write("UK<br>")
dateString = "1/4/10" 'represents...
As far as I can tell, there is no EDIT function on this site, so let me clarify by saying that the value for dateString is written via the UK format and is supposed to represent "April 1, 2010".
Hi,
Let's suppose I have the following code:
<html>
<head>
<title>Untitled</title>
</head>
<body>
<script type="text/vbscript">
Dim aDate
Dim dateString, country
country = "UK"
dateString = "1/4/10"
if country = "UK" then
aDate = CDate(dateString)
document.write(aDate & "<br>")...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.