Click here to Skip to main content
13,251,495 members (56,201 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Hi frens

I need to convert the following code(vb) to c# can i do it

DateAndTime.WeekdayName(DateAndTime.Weekday(iDate,Constants.vbsunday),false,constants.vbsunday + "" + DateAndTime.MonthName(DateAndTime,Month(idate))+ "" ;

Thanks in Advance
Posted 21-Dec-12 3:04am
Updated 21-Dec-12 3:30am
Krunal Rohit 21-Dec-12 8:07am
What you are trying to achieve ??
Zoltán Zörgő 21-Dec-12 8:31am
It looks to me as simple formatting... What is the input, and what output you want?
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

With the exception of one missing bracket it is already C# - as shown by the terminating semicolon.

You have a missing close bracket, which I assume should be after the vbsunday.

To translate from VB to C# try this:[^]
darshan559 21-Dec-12 9:01am
Thanks for the reply .....Ya i tried to convert to c# using a tool ....Actually It ws in VB ....DateandTIme.WeekDayName() i guess is a inbuilt VB Function Which is not available in c#...So i need C# equivalent of DateandTIme.WeekDayName(); function
OriginalGriff 21-Dec-12 9:06am
DateTime now = DateTime.Now;
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Rate this: bad
Please Sign up or sign in to vote.

Solution 3


Some online convert tools:[^][^]
And to get the DateAndTime class, you need to add a reference to Microsoft.VisualBasic.dll.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web03 | 2.8.171114.1 | Last Updated 21 Dec 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100