Date raw date time

I have a value in a string array that is {3/15/1976}

When I do a tostring with a short date it changes that to 15/03/1976
Is there a way I can get just the raw text out of the string? Without it giving it to me as a date?
Thanks
0
latrotter2
3/11/2005 1:18:15 AM
asp.net.getting-started 91979 articles. 3 followers. Follow

3 Replies
732 Views

Similar Articles

[PageSpeed] 51

Hi latrotter2,

If you have a DateTime object and want to the string value to have a certain format, you must pass the format to the .ToString() Methos. Example:

[Visual Basic]
Dim tempDateString As String = DateTime.Today.ToString("M/d/yyyy")
Response.Write(tempDateString)
[C#]
string tempDateString = DateTime.Today.ToString("M/d/yyyy");
Response.Write(tempDateString);

Hope this helps.
Thanks,
Geoffrey McGill - Product Manager
Basic Date Picker - A Quicker Picker(TM) - ASP.NET Calendar, Date and Time Web Controls
0
BasicDatePicker
3/11/2005 8:24:10 PM
You are using a "string array". Do you mean a DateTime because the ToString() method will not reformat an array using date formatting rules. DateTime.ToString() converts to a string looking like a date.

You can pass any desired date format into the ToString() method of the DateTime object.
For example, if the DateTime is in the variable myDate:
myDate.ToString("MM/dd/yyyy")
myDate.ToString("MMddyyyy")
--- Peter Blum
Creator of Peter's Data Entry Suite (formerly Professional Validation And More and Peter's Date Package) and Peter's Polling Package
www.PeterBlum.com
0
plblum
3/11/2005 9:09:36 PM
Just completing...

MyDate.ToString("MM/dd/yyyy HH:mm:ss.fff") or hh
0
julianobosco
3/11/2005 9:29:25 PM
Reply:

Similar Artilces:

Dates, Dates, Dates!
Hello all... I am in the process of building an appointment system, and I am trying to see if I can get some pointers on which way to go on this. The first version of this appointment system was very lo-tech, and it stored all of the possible dates/times in the database. Once a user booked an appointment, their information was logged to that date/time, and then that date/time would no longer show in the list of possible openings. This was great for a temporary fix, but with having to pre-populate all of the dates/times, the system would eventually have to be updated to continue on pa...

date/time or date and time
I am setting up an SQL database and I will need to get differences in dates. For example I have a start date, start time, completion date and completion time and I want to get the difference between the start and completion. Would it be better to have one field with both date and time in it, or better to have a date field and a time field? Even though I have already started setting up the tables with seperate fields for date and time I am now leaning toward one field with date/time in it. (Only because that is the way I had to do it when setting up an Excel spreadsheet for a similar ta...

calendar date span (date start : date end)
Hi! Can anyone help me with this? Say, I have these two textboxes. Date Start:        Date End:             What I wanted to do is to put dates on it using the calendar. My problem is I do not know what to do to keep the "Date Start" not way after the set "Date End", and for "Date End" not way before the set "Date Start".   example: Date Start: July 1, 2008              &nb...

From Date and To Date
 In my application i have two textboxes.One for From date and the other one for To date.I need to check whether the From date is lesser than To Date..Date formats will be either(DD-MM-YYYY) or (DD/MM/YYYY).and i have used calendar extender for selecting dateI need the script code to do this...Thanks in advance See this thread: http://forums.asp.net/t/1346328.aspxMohsin Naeem"Please mark as answer if it helped you"  <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server"> </...

from date to date
I am working on a form for livestock. one of the things in the form is a checkbox to let me know if they qualify or not. the second is I have a created record field entered into the database... now my question is I am doing a search on this and cant figure it out since i am new to all this...i have a query that selects the qualification checkbox (where qualify = 'true') then another query that selects the created record date... and the search is that I want to get the information in the livestock that are qualifyed (have the checkbox qualify = to 'true') between  one dat...

java date time and utc date time
hi i have a client written in delphi the backend is written in java (webservice) when fetching a date field from the db, through java to delphi (TXSDateTime class), for some reason the date changes. in the db: 30/07/2009 00:00:00 in delphi: xsdatetime.asdatetime = 29/07/2009 23:00:00 (1 hour before) in delphi xsdatetime.asutcdatetime = 29/07/2009 21:00:00 (3 hours before) i guess it's a matter of timezones but all we want is simply to fetch the same date as it appears in the DB what are we missing? thanks amos szust wrote: > hi > > i have a client written in d...

How to get week start date, End date for a given week nunber,year?
I want  a javascript function to to get the starting date and end date of a week when I have given the week number (1 to 5), Month number (1 to 12), valid year as parameter. How to do that?Manivannan  You can visited http://www.datejs.com/2007/11/I dont have example.Hope it's help you. try this example function GetWeekStartEndDate(){    var week = 5;    var month = 4;    var year = 2008;        var PositiveOneDay = new Date(new Date('1/2/2000') - new Date('1/1/2000'));   &...

HOW TO COMBINE A DATE COLUMN AND A HOURS COLUMN IN A DATAGRID TO GET FULL DATE AND TIME
Hello There!,          First of all i have a date column and a text box column in my datagrid . i am populating the date column through the below code  DataTable Table3 = new DataTable();         DataColumn Date = new DataColumn();        Date.ColumnName = "Date";   Table3.Columns.Add(Date);  DateTime Crnt_Time =DateTime.Now;        int day = Crnt_Time.Day;        int mnth = Crnt_Time....

just Time or date portion of a date/time field
Good Day, From a DateTime data column how do I get just a Time portin or just a date portion of data to be displayed. i.e from 11/6/2003 10:03:20 AM I need to display date and time seperately in my data display page. Thanks Regards, In code you could use Dim dt as System.Date Dim day, month, year as integer day = dt.Day month= dt.Month year = dt.Year This also works with DateTime In SQL you could use DATEPART(<datepart>,<datetime>) where <datepart> is the abbreviations mentioned in post 385301 and <datetime> is a...

Getting dates between 2 dates
Hi all, Would like to make an enquiry, if i have 2 dates, how can can i get all the dates between these 2 dates. Thanks for the help.   You will probably need to loop through the dates;               DateTime startdate;            DateTime enddate;            List<DateTime> allDates = new List<DateTime>();            allDates.Add(startdate);         ...

DATE field to DATE/TIME
Hello, If the field is defined as a DATE and you do: select datefield+1 from mytable Does the ODBC API (actually ASA 9.02 backend) return a field that is DATETIME or a DATE field? It is messing up my compiled application and seems to be coming back as DATETIME. Thank you. -Robert You are correct, the value is being returned as a TIMESTAMP. You can verify this through using the EXPRTYPE() builtin function, as in select exprtype('select datefield+1 from mytable', 1) from dummy which will return TIMESTAMP. Exprtype is documented in the help. You alm...

Start date and End Date
Hi, Working on a create user workflow i need to add a mandatory start date for the user and an optional end date for some users. I have two fields for this in the request form of type date and control Type is DatePicker. There is an eDirectory attribute called loginActivationTime, is that used for activating an account at the preset time? End date, is that Login Expiration Time ? And I think I have to repormat the dates as well ? I have found some discussions about date formats but what is the best practice on how to do a reformat if I use IDM 3.6 and UA3.6.1 ? I guess I...

Get the dates between two dates
Hi all, I want to get all the date between two dates. For example I have a StartDate="12/5/2003" and a EndDate="12/7/2003" the result should be 12/5/2003 12/6/2003 12/7/2003 Ant help is appreciated Thanks for ( DateTime theDate=StartDate ; theDate<=EndDate ; theDate.AddDays(1) ) { // Do something...theDate.ToShortDate() would give the string... } Starting with ASP.NET 2.0? Look at:Programming Microsoft Web Forms My Blog I get a syntax error as :"For loop variable cannot be of type Date" Hmm. The below work...

Convert Date/Time to Date
Hi I'm using .NET 2.0 framework with a Postgres DB. I'm getting date values from the table 'creationdate' and I need to compare it with other date value (given by me). The thing is that tha date returned from the DB comes like this '27-03-2006 0:00:00' and the date value that I use to campare comes like this '27-03-2006'. I want to know how to convert the returned date value from the DB to date only...?! I tried using the following: SELECT CONVERT(char(10),creationdate,101) AS date FROM calendar.events WHERE date = "myDate"; but it gives me an error: syntax error at or near "," at c...

Web resources about - Date raw date time - asp.net.getting-started

List of members of the Swiss Federal Council by date - Wikipedia, the free encyclopedia
The Swiss Federal Council and the Federal Chancellor as of February 2008. From left to right: Eveline Widmer-Schlumpf , Moritz Leuenberger , ...

The science behind the weird pattern to Australia's most popular wedding dates
Australians aren't known to be superstitious, but a survey of the most popular wedding dates from 2007 to 2014 reveals a remarkable pattern. ...

Pearl Harbor 74th anniversary: 7 facts about Dec. 7, 1941, a 'date that will ...
AL.com Pearl Harbor 74th anniversary: 7 facts about Dec. 7, 1941, a 'date that will ... AL.com A floral wreath is placed in the water to memorialize ...

MLS Cup 2015: Columbus Crew v Portland Timbers Date, Time, Live Stream, TV Info - Bleacher Report
The Columbus Crew will host the Portland Timbers in the 2015 MLS Cup on Sunday, as the visitors seek their first MLS Cup win and the hosts will ...

No date set yet for sentencing of Oscar Pistorius for murder
Boston Herald No date set yet for sentencing of Oscar Pistorius for murder Boston Herald CORRECTS TO THURSDAY - FILE - In this Thursday Sept. ...

Nada Surf releasing 'You Know Who You Are' in March, share "Believe You're Mine," announce 2016 tour ...
by Bill Pearis Nada Surf will release their new album You Know Who You Are, on March 4, 2016 via Barsuk. This is the first album Nada Surf has ...

Microsoft has announced the date it will kill support for its mobile operating system
... not currently available to non-Microsoft consumer devices, but the company has already made it clear that support — which means regular updates ...

Uncharted 4 multiplayer beta start date moved up
Uncharted 4 multiplayer beta start date moved up

Relativity Dates Five Films For 2016 Including ‘Masterminds’ & ‘Kidnap’
Relativity Studios has announced 2016 release dates for a quintet movies that some thought might never see the inside of a theater — at least ...

Dark Souls III now has a confirmed US release date of April 12
In their new "Darkness Has Spread" trailer, Namco Bandai has confirmed the final release date of Dark Souls III April 12, 2016. Before this, ...

Resources last updated: 12/7/2015 2:12:30 PM