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

White space issue when parsing datetime

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 1158
parez,

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
"parez" <ps*****@gmail.comwrote in message
news:11*********************@g4g2000hsf.googlegrou ps.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...
2
by: Malcolm Dew-Jones | last post by:
I am looking at xslt 1.0 and trying to understand if empty text nodes are supposed to be stripped or not as the default behaviour. 3.4 starts by listing rules for when white space is not stripped...
0
by: Mark Moore | last post by:
I'm trying to layout a couple text input fields and their corresponding labels without using a table. When I was trying to debug my understanding of CSS, I was *very* surprised to see that span's...
3
by: Simon Dean | last post by:
Hello! Im looking to try and get into CSS for formatting my sites. Seems like a nice premise, and should allow easier design for the future. But gees, Im having a hard time of it. I would...
5
by: Jonathan Ng | last post by:
Hi, I was wondering if there was a way to include the white spaces in a string. Currently, I am using: scanf("%s", &input); However, this doesn't include the 'space' character or any other...
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: 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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.