pvg1975
asked on
right function. Translation from VB 6 to .NET
Hi all,
How do I translate the following in ASP.NET?
XMonth= Right("00" & Month(now()), 2)
I tried
Dim XMonth as String = Right("00" & Month(Today), 2)
but its giving me an error on the right function
Thanks!
How do I translate the following in ASP.NET?
XMonth= Right("00" & Month(now()), 2)
I tried
Dim XMonth as String = Right("00" & Month(Today), 2)
but its giving me an error on the right function
Thanks!
When I say, "your code still technically is valid," I am referring to the old VB6 code (i.e. your first snippet), not the one I quoted. Sorry if it caused confusion.
ASKER
Hey K
That will result in, for example 12 for december, 05 for may (not 5), 01 for june, etc?
Thanks!
That will result in, for example 12 for december, 05 for may (not 5), 01 for june, etc?
Thanks!
ASKER
Sorry I mean 01 for January :P
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I cannot try it now, that's why I ask BTW :)
ASKER
Thanks! I will try it as soon as Im back home. Thanks again! :)
No problem. Glad to help = )
P.S.
Feel free to post back if you have any questions about the above.
P.S.
Feel free to post back if you have any questions about the above.
Open in new window