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

White space issue when parsing datetime Options

Hi All,

i have two accepted formats.
expectedFormats = New String() {"%M/%d/yyyy", "%M/%d/yyyy hh:mm:ss
tt"}
dt = DateTime.ParseExact(txtInpDateString.Text, expectedFormats,
culture.DateTimeFormat,
Globalization.DateTimeStyles.AllowWhiteSpaces)
and i get 05/14/200711:22:33 AM as a valid date. (Note: there is no
space between year and time) and i am pretty sure zero lenght string
is not a white space.
Please help

Jun 8 '07 #1
1 1315
psawant,

DateTime.ParseEx is used to read a string into a DateTime object. The
example you show is a String so I assume you are doing a dt.ToString with
some output format?
Steve

<ps*****@gmail.comwrote in message
news:11*********************@q69g2000hsb.googlegro ups.com...
Hi All,

i have two accepted formats.
expectedFormats = New String() {"%M/%d/yyyy", "%M/%d/yyyy hh:mm:ss
tt"}
dt = DateTime.ParseExact(txtInpDateString.Text, expectedFormats,
culture.DateTimeFormat,
Globalization.DateTimeStyles.AllowWhiteSpaces)
and i get 05/14/200711:22:33 AM as a valid date. (Note: there is no
space between year and time) and i am pretty sure zero lenght string
is not a white space.
Please help

Jun 9 '07 #2

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

Similar topics

8
by: Gerrit Holl | last post by:
Posted with permission from the author. I have some comments on this PEP, see the (coming) followup to this message. PEP: 321 Title: Date/Time Parsing and Formatting Version: $Revision: 1.3 $...
2
by: \Dandy\ Randy | last post by:
Hello everyone. I have been following misc posts, as well as reading several FAQ's on this issue, unfortunatley I cannot locate a solution. I am hoping that someone will be able to provide me with...
6
by: Ot | last post by:
I have an xml document similar to this <all> <one> <options attr1="1" attr2="2" /> <item name="a name" attr1="1" /> <item name="another" attr1="2"/> </one> <two> <options attr1="1"...
6
by: Dario Di Bella | last post by:
Hi all, we have the following urgent issue affecting our development team. Initially we had one particular workstation that failed executing queries on a DB2 database, raising an invalid date...
2
by: shagy | last post by:
Hi, I'm having a problem with a <select><option> which has white space in values... When I post the data I only get the first word (up to the white space). "Testing white space" becomes...
3
by: parez | last post by:
Hi All, i have two accepted formats. expectedFormats = New String() {"%M/%d/yyyy", "%M/%d/yyyy hh:mm:ss tt"} dt = DateTime.ParseExact(txtInpDateString.Text, expectedFormats,
1
by: parez | last post by:
Hi All, i have two accepted formats. expectedFormats = New String() {"%M/%d/yyyy", "%M/%d/yyyy hh:mm:ss tt"} dt = DateTime.ParseExact(txtInpDateString.Text, expectedFormats,...
5
by: Richard Maher | last post by:
Hi, Can someone please show me how to tell Firefox to preseve white-space when returning the selectList.option.value attribute? I have change the style so that the white-space is preserved on...
7
by: Daniel Fetchinson | last post by:
Many times a more user friendly date format is convenient than the pure date and time. For example for a date that is yesterday I would like to see "yesterday" instead of the date itself. And for...
1
by: bdbeames | last post by:
I am currently getting some forecast data from a web site using (file_get_contents), then I'm using explode to put the string in an array, which I am then parsing. The trouble is when I use...
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:
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...
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
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.