473,800 Members | 2,640 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Equivilent of VB's DatePart

I'm trying to find an equivilent function to VB's DatePart function.

I have a Year, Month, the Day of week (Sunday, monday etc.) and the week
(week 1, week 2) and I need to find the date of that month.

Can anyone help me with this?
/RT
Nov 17 '05 #1
1 4867
There are instance properties available on DateTime variables (e.g., Day)
--
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB.NET to C# Converter
Instant VB: C# to VB.NET Converter
Instant J#: VB.NET to J# Converter
Clear VB: Cleans up outdated VB.NET code
"Ryan Ternier" wrote:
I'm trying to find an equivilent function to VB's DatePart function.

I have a Year, Month, the Day of week (Sunday, monday etc.) and the week
(week 1, week 2) and I need to find the date of that month.

Can anyone help me with this?
/RT

Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4276
by: CES | last post by:
All, I'm trying to figure out how I would execute code that would be shared over a number of wwwroot folders. Basically it would be the equivalent of an .inc file only instead of residing below the wwwroot it would exist above (FYI - I want to do this so when information changes on a page like my "Terms of Use" it will be reflected throughout each site I maintain) as apposed to changing the file for each domain.
1
1726
by: Crash | last post by:
I want to call the DateAndTime.DatePart() Method in VB from C#, i have correctly added the reference to the VB dll, etc... but when i call this function like this DateAndTime.DatePart(DateInterval.Weekday,DateTime.Now,FirstDayOfWeek.Sunday,FirstWeekOfYear.Jan1) or DateAndTime.DatePart(DateInterval.Weekday,DateTime.Now)
2
21745
by: John Galt | last post by:
I was looking at a VB.NET program that is passing strings to method calls using ByVal. I was wondering if this is for a reason and, if so, should a C# conversion of code samples from VB.NET also use an equivilent rather than passing strings by reference?
3
1782
by: CES | last post by:
All, I'm trying to figure out how I would execute code that would be shared over a number of wwwroot folders. Basically it would be the equivalent of an .inc file only instead of
4
6469
by: MikeLing | last post by:
Hi, String.IndexOf is case sensitive so I need to covert to lower before testing the string contains a given string. In VB this is: Instr(Lcase(StringToTest, "StringToCheckFor")) What is the C# equivilent? The closest I've comeup with is: string lowerString = testString.ToLower();
0
3427
by: jdavidson | last post by:
I have not worked with VB at all and wondered if perhaps there was an all knowing SQL DBA out there that also spoke fluent VB. I am trying to come up with the equilivant T-SQL code for the following VB script (it is a portion of an old Access query) and certainly appreciate any help offered!! Thanks (and sorry about the table names....i didn't create the database) 1) & " " & IIf( Is Not Null, & ". ","") & AS , 2)...
3
2293
by: funfair | last post by:
Hi, I'm facing a strange problem in access 2003 i dont know how to solve it i have a code in VB which give an autonumber but in finanical new year it reset to 1 on new year it works in one form but the same code doesnt work in other form in run time it's going to skip if satatement of date part to check if month is 4 or not what is the problem ? i have looked in the net and i read somehting about reference what should i do about it .
2
13301
by: Brian Henry | last post by:
Is there a .NET equivilent of the "internal" keyword in VB.NET? say if i had this in C# internal bool b_MyBoolean;
2
2936
by: oh4real | last post by:
Howdy all. I have pretty much NO VB/Access coding experience, but am forced to come up with a generic script/process for users with varying database designs and varying levels of expertise to use and integrate into their Dbs. Following is my script and is launched On_Open event. The script determines someone's desired upload class (test, archive or recent), executes a specific query based on that info, then writes the query results to a...
0
9690
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10504
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10274
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10033
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7576
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6811
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5469
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4149
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.