I have a VB 6 source code, and I am rewriting it in .NET At some places I have found a date is converted into "mmddhhnn" format. I am not sure what is "nn" here, also if I put as it is in .NET, then it doesn't convert nn into anything rather it remain "nn" only. What is its equivalent in .NET?
-
2I would suggest taking an approach of finding out what your current code does, before trying to port it. The question of what "nn" means in VB6 has nothing to do with .NET. Decouple the "understanding current code" from "migrating to new code" parts. (It looks like Oded has your answer in this case, but you should think about this as a general approach. You can't tell whether or not a migration is successful if you don't know what the code is meant to do.)– Jon SkeetCommented Apr 29, 2013 at 9:31
Add a comment
|
2 Answers
-
1+1 And here is a link to the relevant official VB6 manual topic on MSDN– MarkJCommented Apr 29, 2013 at 12:22
-
@MarkJ - That's a nice link, but it is a VBA reference, not VB6.– OdedCommented Apr 29, 2013 at 12:23
-
True enough, but it seems to be the only relevant documentation on MSDN & it's linked from the "See also" in the VB6 topic on Format.– MarkJCommented Apr 29, 2013 at 12:26
-
1
According to this site nn
means minutes with leading zero.
So this should be equivalent:
Dim dateString = date.ToString("MMddHHmm")
Uppercase MM
means months and lowercase minutes. Uppercase HH
means hours in 24 hours, lowercase using a 12-hour
-
The joys of multiple date/time formats in Microsoft products! ;o)– user1945782Commented Apr 30, 2013 at 12:12
-