Unanswered: Char to Date Conversion independent of Regional Settings
* Firstly, how do I convert a string to a Date regardless of the bloody control panel/Regional Settings? I need a way to say that dd is this much, mm is this much and yyyy is this much. (Like JScript new Date(yyyy, mm, dd))
* Secondly, what kind of idiots are behind VBScript? The usual kind, sophisticated or extreme? Should'nt we have a poll on this.
if you can't pull what you need from this just do a search on date manipulation vbscript in google. There's lots of functions out there and you just need to find the one you need, if you still can't find what you need make a class.
if you need to display the 0's then just check the length of the month and day prior to assigning it to the getMonth and getDay variables.
something like this
if(Len(Month(newDate)) = 1) then
'month is 1 digit, place a zero in front of it
getMonth = "0" & Month(newDate)
else if(Len(Month(newDate)) = 2) then
'month is 2 digits
getMonth = Month(newDate)
What I wanted was a way to explicitly specify each portion of a Date object regardless of the settings in the Control Panel. Cannot use CDate since it interprets its argument depending on the Regional Settings.
Anyway, got what I wanted:
DateSerial(year, month. day) and TimeSerial(hour, minute, second)