O
\(O\)enone
In VB6, the Format() function when applied to dates used some "intelligence"
in order to handle the double-meaning of some characters. For example, the
following command:
\\\
MsgBox Format(Now, "yyyy-mm-dd hh:mm:ss")
///
....would correctly interpret the "mm" within the date part as the month, and
the other "mm" in the time part as the minute.
In VB.NET, they changed to the more predictable mechanism of using different
characters for "month" and "minute", so the above function is now:
\\\
MsgBox(Strings.Format(Now, "yyyy-MM-dd HH:mm:ss"))
///
Does anyone know of a function that will reliable translate from the old VB6
format string to the new .NET one? In other words, I'm looking for a
function for which if I pass in the string "yyyy-mm-dd hh:mm:ss", it returns
the value "yyyy-MM-dd HH:mm:ss".
Many thanks,
in order to handle the double-meaning of some characters. For example, the
following command:
\\\
MsgBox Format(Now, "yyyy-mm-dd hh:mm:ss")
///
....would correctly interpret the "mm" within the date part as the month, and
the other "mm" in the time part as the minute.
In VB.NET, they changed to the more predictable mechanism of using different
characters for "month" and "minute", so the above function is now:
\\\
MsgBox(Strings.Format(Now, "yyyy-MM-dd HH:mm:ss"))
///
Does anyone know of a function that will reliable translate from the old VB6
format string to the new .NET one? In other words, I'm looking for a
function for which if I pass in the string "yyyy-mm-dd hh:mm:ss", it returns
the value "yyyy-MM-dd HH:mm:ss".
Many thanks,