473,386 Members | 1,819 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,386 software developers and data experts.

Seperating date from time

I've been using the following C# code. I need only the date and not the time.can you help me out?

Expand|Select|Wrap|Line Numbers
  1. public string dt
  2.     {
  3.         get
  4.         {
  5.             string date;
  6.             date = System.DateTime.Now.ToString();
  7.             return date;
  8.  
  9.  
  10.         }
  11.     }
Feb 21 '07 #1
2 1180
keyu
9
try this

System.DateTime.Now.Date.ToString();
Feb 21 '07 #2
indoo
5
I've been using the following C# code. I need only the date and not the time.can you help me out?

public string dt
{
get
{
string date;
date = System.DateTime.Now.ToString();
return date;


}
}


date=System.DateTime.Now.ToShortDateString();
Feb 21 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: vool | last post by:
Hi All Can anyone help with this please. I need a way of putting say 10 to 20 bullet points in one table field in an Access database - say seperate them with a special character, then build a...
2
by: androtech | last post by:
Hello, I'm looking for a function that returns a date range for a specified week number of the year. I'm not able to find functions like this anywhere. Any pointers/help would be much...
5
by: Tyler Smith Watu | last post by:
I will like to seperate the contents of sp_dbfixedrolepermission into groups by the fixedrole (With the LUXURY of a heading).Is there a any short way or straight forward command to do that? ...
8
by: Thomas van den Berg | last post by:
how can I count the number of blank-seperated word groups in a single field. The format I receive is aaa (aaa aaa )n(nnn). aaa can be any number of words, any length. The n(nnn) is not fixed length...
6
by: Jo K. | last post by:
I have a bounded field called Name. It's used to type in the full name of a customer (intentionally set up that way instead of seperating the first and last names) I would like to be able to...
0
by: AnkitAsDeveloper [Ankit] | last post by:
As all we know, in order to remove cyclic includes in C++ we seperate the declarations and definitions of classs and it's member in two files Header (*.h) and source files (*.cpp). This is not a...
15
by: Khurram | last post by:
I have a problem while inserting time value in the datetime Field. I want to Insert only time value in this format (08:15:39) into the SQL Date time Field. I tried to many ways, I can extract...
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...
5
by: jaz215 | last post by:
hi! i just want to seperate the date and time from a date variable is there a way to do this? what i thought of is trimming but i dont know if that would really work i want to have a date datatype...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
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
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.