473,385 Members | 2,044 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

date question

hey all,

i was wondering, you know how you can say fieldDate.Month or fieldDate.Day
in vb.net to pick apart the individual date components. If the month is
between 1 and 9 to append a zero in front of that month (i.e. 01, 02, 03)
without going thru heavy string manipulation?

is there some sort of format command you can use with the .month or .day
property? please say yes.

thanks,
rodchar
Nov 21 '05 #1
2 854
Call the ToString method of DateTime with appropriate formatting string

Standard format strings:
http://msdn.microsoft.com/library/de...matstrings.asp

Custom format strings:
http://msdn.microsoft.com/library/de...matstrings.asp

"rodchar" <ro*****@discussions.microsoft.com> wrote in message
news:BE**********************************@microsof t.com...
hey all,

i was wondering, you know how you can say fieldDate.Month or fieldDate.Day
in vb.net to pick apart the individual date components. If the month is
between 1 and 9 to append a zero in front of that month (i.e. 01, 02, 03)
without going thru heavy string manipulation?

is there some sort of format command you can use with the .month or .day
property? please say yes.

thanks,
rodchar

Nov 21 '05 #2
awesome, thank you very much.

"Marina" wrote:
Call the ToString method of DateTime with appropriate formatting string

Standard format strings:
http://msdn.microsoft.com/library/de...matstrings.asp

Custom format strings:
http://msdn.microsoft.com/library/de...matstrings.asp

"rodchar" <ro*****@discussions.microsoft.com> wrote in message
news:BE**********************************@microsof t.com...
hey all,

i was wondering, you know how you can say fieldDate.Month or fieldDate.Day
in vb.net to pick apart the individual date components. If the month is
between 1 and 9 to append a zero in front of that month (i.e. 01, 02, 03)
without going thru heavy string manipulation?

is there some sort of format command you can use with the .month or .day
property? please say yes.

thanks,
rodchar


Nov 21 '05 #3

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

Similar topics

2
by: mirza i | last post by:
thanks for the previous replies. here is the new question (i'm absolutely sure that this should be VERY easy for a good js coder) ok: from asp i call: <img src="pics/cal.gif"...
12
by: Steve Elliott | last post by:
I have a query set up to gather together data between two specified dates. Shown in the query column as: Between #24/09/2004# And #01/10/2004# Is it possible to enter several different date...
5
by: Kermit Piper | last post by:
Hello, I am comparing two date values, one from a database and one that has been converted from a hard-coded string into an actual Date type. So far so good. The problem I'm having is that one...
6
by: Luvin lunch | last post by:
Hi, I'm new to access and am very wary of dates as I have limited experience in their manipulation and I know if they're not done properly things can turn ugly quickly. I would like to use a...
2
by: syntego | last post by:
We commonly use triggers to log changes to our main tables to historical log tables. In the trigger, we create a concatenated string of the old values by casting them as follows: ...
44
by: user | last post by:
Hi, Let's say I have 2 dates in the b/m format: Date 1 and date 2 How do I check whether Date2 is later than Date 1? Date1. 21-Nov-2006 09:00:00 PM
10
by: dan | last post by:
Am i breaking any rules when I loop dates like // Determine Memorial Day intFlag = 0; memDayHol = new Date (currentYear, 4, 31); while (intFlag == 0) { if (memDayHol.getDay() == 1) {intFlag...
10
by: ARC | last post by:
Hello all, General question for back-end database that has numerous date fields where the database will be used in regions that put the month first, and regions that do not. Should I save a...
9
by: Martin | last post by:
I'm retrieving some records from a database. One of the fields contains a date/time. I would like to format it as I send it out to the table in the displayed page. Can some one please tell me...
6
by: Geoff Cox | last post by:
Hello, at the moment I can add the combined date and time into MySQL using php $dt1 = date("Y-m-d H:i:s"); is it possible to add the date and time separately? I thought it might be
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
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
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...

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.