473,513 Members | 2,420 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Split the date

i want to split date as date ,month, year, from the input like
value of textbox1.text="03/06/2007"

i want it like

03(month)

06(day)

2007(year)

separately, and want to store each value in different integer
variables

plz send coding....

Mar 13 '07 #1
1 2729
Hi

try

DateTime dt = DateTime.ParseExact("03/06/2007","MM/dd/yyyy",null);
dt.Month
dt.Year
dt.Day

Adlai
---------------------------------
If my answer helped you please press "Yes" bellow

Adlai Maschiach
http://blogs.microsoft.co.il/blogs/adlaim/
"aj******@gmail.com" wrote:
i want to split date as date ,month, year, from the input like
value of textbox1.text="03/06/2007"

i want it like

03(month)

06(day)

2007(year)

separately, and want to store each value in different integer
variables

plz send coding....

Mar 13 '07 #2

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

Similar topics

2
12799
by: SL_McManus | last post by:
Hi All; I am fairly new to Perl. I have a file with close to 3000 lines that I would like to split out in a certain way. I would like to put the record type starting in column 1 for 2 spaces,...
4
2409
by: kinne | last post by:
The following code is supposed to reverse the date in "yyyy-mm-dd" format, but it produces different results in Firefox 1.0 and in Internet Explorer 6SP1. In Firefox, the result is correct...
5
8688
by: Sen Haerens | last post by:
I'm using string.split(/^$/m, 2) on a curl output to separate header and body. There’s an empty line between them. ^$ doesn’t seem to work... Example curl output: HTTP/1.1 404 Not Found...
6
2152
by: Saurabh | last post by:
Hi everyone, I am looking for some expert advise to get me out of trouble. I am looking for a solution in C# which will allow me to split the below string in the format provided. The...
3
5728
by: David | last post by:
Hi, I have a form which is posting a user entered date to an asp page. The date is then used in a SQL string. The format of the date is received as dd/mm/yyyy, with the user typing the '/'...
1
4802
by: clayalphonso | last post by:
Here is the code: <% dim testArray, testArray2 dim Conn, rs dim sSQL, sConnString 'response.write request.form("sel1") 'testArray = split(request.form("sel1"),",") 'for each gidstuff In...
8
1641
by: Flyzone | last post by:
Hi, i have a problem with the split function and regexp. I have a file that i want to split using the date as token. Here a sample: ----- Mon Apr 9 22:30:18 2007 text text Mon Apr 9...
1
1199
by: phpLrnr | last post by:
Hi, I need to split the system date in three parts, I need the day in a variable the month in another and finally the year in another, I allready get the system date with the following code: $toDay...
5
3010
Kelicula
by: Kelicula | last post by:
Hello all. I have a problem which seems to make no sense to me. Therefore I must be doing something wrong. I am trying to populate an array using split with a regexe. Here is the code (snippet...
5
26693
by: ghjk | last post by:
I want to split date and time in java script.ex: Date=2009-08-12 and Time=14:30:00 selectedDateTime = 2009-08-12 14:30:00 date = selectedDateTime.split(" ") + "<br>"; But I got the same value...
0
7259
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,...
0
7158
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7380
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,...
0
7535
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...
0
7523
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...
1
5085
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...
0
1592
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 ...
1
798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
455
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.