|
by: Fred Strauss |
last post by:
I am having an odd problem using the DateTime.ParseExact() method that
I'm hoping someone can help me with.
I have XML files that use 2 different date formats internally. I am
trying to use the same call to ParseExact to parse either format. I am
using C# to call the following form of ParseExact:
public static DateTime ParseExact(string, string, IFormatProvider,
DateTimeStyles);
|
by: Dave P. |
last post by:
I'm trying to parse a string into a DateTime object. I
want to try using ParseExact to see if I can improve
performance of a frequently-called method (i.e., please
don't suggest using Parse()). My code looks like this:
IFormatProvider fp = new System.Globalization.CultureInfo
("en-US");
DateTime dt = DateTime.ParseExact("Mar 9, 2005", "MMM d,
yyyy", fp);
|
by: Cor Ligthert |
last post by:
Hello everybody,
Jay and Herfried are telling me every time when I use CDate that using the
datetime.parseexact is always the best way to do String to datetime
conversions. They don't tell why only that I have to listen to them because
they know it better.
They told also that in a business situation it is better to use
datetime.parseexact for changing cultures and not to use the globalization
setting. I did not give them this sample,...
|
by: Pablo |
last post by:
Hello,
I have big problem with method ParseExact from class DateTime.
Here is code sample:
'-----------------------------------------------------------------------------------------------------------------------------------------
Module Module1
Sub Main()
Console.WriteLine("Start...")
Try
|
by: Erica |
last post by:
Hi.
I have a string: "11/24/2006 23:59" named StartDateTime
I need the string to be converted into a DateTime object in the following
format: 2006-11-24 11:59 PM
I tried the following: DateTime.ParseExact(StartDateTime,"yyyy-MM-dd HH:mm
tt*", System.Globalization.CultureInfo.CurrentCulture)
|
|
by: schouwla |
last post by:
How do I use DateTime.Parse or DateTime.ParseExact to create a
DateTime object from a string?
I tried this without luck:
string dateString = "27-02-2007";
// DateTime dt = DateTime.Parse(dateString);
// Throws a FormatException exception
IFormatProvider culture = new CultureInfo("fr-FR", true);
DateTime dt = DateTime.ParseExact(dateString, "dd-mm-yyyy", culture);
Console.WriteLine(dt);
|
by: Peter Duniho |
last post by:
I'm sure there's a good explanation for this, but I can't figure it out.
I tried using DateTime.Parse() with a custom DateTimeFormatInfo instance,
in which I'd replaced the DateTimeFormatInfo.FullDateTimePattern property
with my custom format string:
DateTimeFormatInfo dtfi =
(DateTimeFormatInfo)DateTimeFormatInfo.InvariantCulture.Clone();
dtfi.FullDateTimePattern = "dd/MMM/yyyy:HH:mm:ss zzz";
|
by: Peter Holschbach |
last post by:
Hi,
I've the following line of code:
result = DateTime.ParseExact("1999-12-01T23:59:59Z", "yyyy-MM-ddTHH:mm:ssZ",
CultureInfo.InvariantCulture);
where I get in result "result" "02.12.1999 00:59:59" instead of teh
expected "01.12.1999 23:59:59"
Anybody a idea ?
|
by: John B |
last post by:
Hi all,
Any idea why this code results in a FormatException?
DateTime.ParseExact("40708", "dMMyy", CultureInfo.CurrentCulture)
If I use "040708" with the same format string it works and it parses all
double digit days fine.
TIA
JB
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
|