?
Solved

date

Posted on 2003-12-10
9
Medium Priority
?
350 Views
Last Modified: 2010-04-16
does any one know how i just get the date and not the date time stamp im using DateTime.Now but would love to use some like Date.Now ?????
0
Comment
Question by:andrew67
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +2
9 Comments
 
LVL 2

Accepted Solution

by:
rogaut1 earned 150 total points
ID: 9912553
Hi,

DateTime.Now.Date();



Hope this helps


Robert
0
 
LVL 3

Author Comment

by:andrew67
ID: 9912591
gets rid of the time stamp but replaces it with 00:00:00 sorry but thanks any way oh and it doesnt need the () bit on
0
 
LVL 2

Expert Comment

by:rogaut1
ID: 9912687
Build a wrapper class around DateTime
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 3

Author Comment

by:andrew67
ID: 9912704
you have lost me a bit there i think i will get the DateTime.Now time stamp assign that to a string then chop the relavent bit of the end
0
 
LVL 20

Expert Comment

by:TheAvenger
ID: 9913610
Just use the DateTime.ToString(string format) method. I don't know what format you need exactly, but here are some examples:

DateTime dt = DateTime.Now;

dt.ToString ("dd.MM.yyyy") -> 10.12.2003
dt.ToString ("dd MMM yyyy") -> 10 Dec 2003
dt.ToString ("d") -> 12/10/2003
dt.ToString ("D") -> Wednesday, December 10, 2003
etc. etc.

For more examples and information have a look here: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdatetimeclasstostringtopic3.asp
0
 
LVL 9

Expert Comment

by:msdixon
ID: 9914979
DateTime.Today


DateTime.Now includes the current time, whereas today is just the date (the hour, min, second & millisecond are set to zero with the Today property)
0
 
LVL 3

Author Comment

by:andrew67
ID: 10130093
string dt = DatTime.Now.ToString();
dt.Substring(0,10);
0
 
LVL 20

Expert Comment

by:TheAvenger
ID: 10131305
Why do you do it like this? What about my post?
0
 
LVL 10

Expert Comment

by:smegghead
ID: 10269917
andrew67,

If you want just the date as a string, just use...

string dt=DateTime.Today.ToString("d");

This will return your date in the format specific to your user's machine.

Smg.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question