datetime-format

ASP.NET AJAX and DateTime Format on the Client

So I've finally got my WCF service setup and talking to browser via ASP.NET AJAX. But I have found that when I populate a html table with my data... the datetime format looks like this: Fri Jan 02 2009 15:27:12 GMT-0500 (Eastern Standard Time) On the server I am using the .NET DateTime format. Should I use something else and do the wor...

Custom date format with jQuery validation plugin

How can I specify a custom date formate to be validated with the Validation Plugin for jQuery? thanks! ...

Applying MaskedTextBox control behavior to a property item field in PropertyGrid

Hi all, I am working on C# and .NET. As we know that, the best way to stop users from entering invalid data into an input control is Masked TextBox by which we can assign a predefined mask such as Short DateTime mask(--/--/----) I have a PropertyGrid and assigned it to an instance of a class which is having properties of DateTime type...

DateTime issue on different platforms (.NET 2.0)

On a 32 bit OS, with an Intel processor, DateTime e.g. 2/17/2009 12:00:00 AM Notice that it is: mm/DD//yyyy On a 64 bit OS, with an AMD processor, DateTime e.g. 17-02-2009 00:00:00 Now when I try to parse the 1st format, it throws an error on the 2nd platform. That means - DateTime.Parse("2/17/2009 12:00:00 AM") - throws an error - can...

Blackberry Java String to date conversion.

Hi, I used following code to convert string to date but it is applying timezone of device while conversion. I don't need this but I want same date/time from that string like String = "2009-07-31 07:59:17.427" Date = 2009-07-31 07:59:17.427 Date formatter = new Date(HttpDateParser.parse("2009-07-31 07:59:17.427")); SimpleDateFormat d...

How to get a Long Date format from DateTime without a weekday

I'm looking for a locale-aware way of acquiring a long date time without the weekday. Just such a beast exist? Below is the code I use to get the long date format including the weekday: DateTime time = ... String formattedDate = time.ToLongDateString(); Edit Examples of what I would like to see: en-us: December 5, 2009 fr-fr: 5 d...

C# DateTime ToString("MM-dd-yyyy") returns funny day values

I have the following code in the codebehind file of an ASP.Net page txtStartDate.Text = DateTime.Today.ToString("MM-dd-yyyy"); Which I expect to return "09-11-2009". However, when I run the page on the development server, I see "09-00-2009" in the text box. I can't see any reason for this, so I'm clearly missing something. Anyone have...

How change the DateTime Universal Sort Format in .NET?

We are trying to force our datetime objects in c# to serialize using a different format than the default. We don't want to include milliseconds. The SortableDateTimePattern and the UniversalSortableDateTimePattern is read-only. ...

.NET global culture on a new server

We've just moved to a new server and everything's being going well. However earlier I ran into a .NET error when it was trying to convert a string in the format "dd/mm/yyyy" to a date, now I changed the culture setting in the local web.config but we require this to be global. Where do I change this? I assumed the machine.config but I co...

How to show DateField with AM/PM format in blackberry?

I don't know how to show Time in AM/PM format in blackberry using blackberry datefield.Pls give me a idea how to do this. ...

Parse CIM_DateTime to .Net DateTime

My application is receiving some date information from WMI. This in the form of strings with the following format: yyyymmddHHMMSS.mmmmmmsUUU For more details on this format, see here. I'm interested in parsing everything before the period. I have the following code: string testDate = "20010701212212"; // July, 01, 2001 21:22:12...

MDYY SQL Format

Is there a way to format a sql date like this: 3/11/2009 (as opposed to03/11/2009) 20/7/2008 (as opposed to 20/07/2008) Thanks! ...

Convert timestamp/date time from UTC to EST Oracle SQL

I have a field with a date/time value like this: 2009-11-17 18:40:05 It's in UTC. In the query how can I convert this to EST? I'm trying something like this but it throws an error. // datetime is the field name SELECT FROM_TZ(TIMESTAMP TO_DATE(datetime, 'yyyy-mm-dd hh24miss'), 'EST') AS DT FROM db_name ...

Ignoring Time stamp for a count in SQL Server 2005

Hi all, I am having an issue figuring out what I thought would be a simple query. I have a table with two fields (EntryDateTime, Message) that as you can guess logs specific messages with a time date stamp for a monitoring app. I am looking to get a count of all messages of a type per day but the time part of the stamp (while needed fo...

How to check if string is a valid DateTime Format string in Delphi

I want user to be able to manually enter format of the datetime fields in the program. I have Tedit component. For example if user enters 'HH:nn', then this is a valid datetime format string and all datetime components should change format property to this, but if he enters 'asd', it is not. Is there a quick way to check this, without wr...

Convert date into the format dd-mm-yyyy

How to convert the date (12/24/2009 12:48:00 PM) into the format dd-mm-yy? I tried the following code: DateTime.TryParse(12/24/2009 12:48:00 PM,out registereddate); strregdate = registereddate.ToString("dd-mm-yyyy"); But, the output comes as 24-48-2009. How to convert ...

mvc.net DateTime with Time part in URI

I have a set of actions that are returning time-series data with-in ranges specifiable to the minute. They work fine with querystrings, i.e. /mycontroller/myaction?from=20091201 10:31&to=20091202 10:34 with or without URL encoded colons, but I thought it would be nice to have a pretty URL /mycontroller/myaction/from-20091201 10:31/to-2...

.NET: Why is TryParseExact failing on Hmm and Hmmss?

I'm trying out the DateTime.TryParseExact method, and I have come over a case that I just don't get. I have some formats and some subjects to parse that each should match one of the formats perfectly: var formats = new[] { "%H", "HH", "Hmm", "HHmm", "Hmmss", "HHmmss", }; v...

Format DateTime like StackoverFlow

Possible Duplicates: Fuzzy date algorithm How do I calculate relative time? Hi, How-to format datetime like SO ? 1 minute ago 1 hour ago asked Aug 15 at 15:00 ...

DateTime.Now.ToShortDateString(); replace month and day

I need to change format of this.TextBox3.Text = DateTime.Now.ToShortDateString(); so it returns (for example) 25.02.2012 I need 02.25.2012 how to realize it ?.. ...