Re: dateTime Manupulations
From: Cor Ligthert (notmyfirstname_at_planet.nl)
Date: 10/20/04
- Next message: Herfried K. Wagner [MVP]: "Re: File.OpenText.ReadToEnd and File Handles"
- Previous message: Dave Coate: "Re: GetNamedSecurityInfo - Read Owner pt II"
- In reply to: Jay B. Harlow [MVP - Outlook]: "Re: dateTime Manupulations"
- Next in thread: Herfried K. Wagner [MVP]: "Re: dateTime Manupulations"
- Reply: Herfried K. Wagner [MVP]: "Re: dateTime Manupulations"
- Reply: Jay B. Harlow [MVP - Outlook]: "Re: dateTime Manupulations"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 20 Oct 2004 19:03:48 +0200
Jay,
Your message shows only that you completly did not read my message or
completly do not understand what is the situation where it is in real
business needed to convert a datetimestring to another culture.
In none of the threads I have read explicitly that there was needed a
datetime conversion between strings, however it was a datetime conversion
between a datetime value and a string value.
So show me first where that culture conversion is needed before you start to
tell that for conversion between a string and a date a CDate is not the best
choise.
Cor
"Jay B. Harlow [MVP - Outlook]" <Jay_Harlow_MVP@msn.com>
> Cor,
> It seems to me you have the blinders on a just a little too tight. :-|
>
> In other words you are only seeing CDate, where as you might want to look
> to the side & see DateTime.ParseExact also!
>
> I agree using the VB Convert Functions in most cases is the way to go.
> However like any rule there are exceptions. As has been demonstrated,
> converting a DateTime with a specific format is one of those exceptions.
>
> An analogy might be a Carpenter. Does a (good) carpenter have a single
> hammer? No, they have 2 or 3 kinds of hammers, as each is needed depending
> on what he is doing. Does he have a single screwdriver? No, he has
> standard (or slotted) and Phillips, plus possible a whole slew of others.
> Does he have a single size of screwdriver? No he has #0 thru #4 sizes
> based on the requirements of the specific job.
>
> The Carpenter has different tools & sizes & shapes of the "same" tool, as
> each is required for a specific job. Same with CDate &
> DateTime.ParseExact. Most of the time CDate (a #2 slotted screwdriver) is
> fine, however sometimes you need a specialized tool, such as
> DateTime.ParseExact (a #0 slotted screwdriver).
>
> For the life of me, I really don't understand why you don't see this.
> Reading Reny & z.'s earlier question both stated, in a specific format,
> which to a number of developers myself included, suggests that
> DateTime.ParseExact with a specific format string is the correct method in
> this instance.
>
> I hope you realize I am not saying don't use CDate, as I use it where
> CDate makes sense.
>
> What I am saying is that CDate does not make sense in this case. For some
> reason you are not accepting this, from Herfried, Jon, myself or others. I
> really don't know why, or how we can better explain it.
>
> In closing, I sincerely hope you will take the time & reread both of these
> threads and make a concerted effort to understand why a number of us may
> be saying that in these two specific cases using DateTime.ParseExact might
> be better then relying solely on CDate. Hopefully you will realize that
> the blinders are just a little too tight.
>
> Hope this helps
> Jay
>
>
> "Cor Ligthert" <notmyfirstname@planet.nl> wrote in message
> news:%23iM$thrtEHA.3564@tk2msftngp13.phx.gbl...
>> Jay,
>>
>> I just following the advice from the VBNet pages to use the Convert
>> Functions from which I understand it is advices to use them because they
>> give the best overall performance.
>>
>> Although when those advices were not given do I find them very clear to
>> use and easy. I find them one of the best extra parts of VBNet.
>>
>> Because of all that doing, from Herfried and others who say that when
>> someone who asks how to set a date and time, and than gives with that a
>> format string, particulary wants to use change a format not in his own
>> local format I give now that other situation.
>>
>> In my opinion are those datestring information more given as extra
>> information for us (what format the OP is using) than that he directly
>> wants to convert the format. I did not by accident give the Australian
>> format when I saw the time of the message. However that was a gues.
>>
>> Beside that can I only think of one situation where it is needed to
>> change the dateandtime given in a culture and that is with a webformpage
>> or with any other document where that is in.
>>
>> Than it is better in my opinion to set in the class that processes that
>> first the right language/culture and set that back at the end of the
>> class. Doing that for every instruction inside will give in my idea more
>> dangerous code when there is maintanance.
>>
>> That has nothing to do with understanding. Sometimes I get the idea that
>> you think that I write things because of lack of knowledge.
>>
>> For me are rules as 80/20 and "keep it simple" very important. A program
>> have to be made however mostly as well will there be maintenance on it.
>>
>> I hope that you can share my opinion above and understand why I am
>> telling this about globalization.
>>
>> Cor
>>
>>
> <<snip>>
>
- Next message: Herfried K. Wagner [MVP]: "Re: File.OpenText.ReadToEnd and File Handles"
- Previous message: Dave Coate: "Re: GetNamedSecurityInfo - Read Owner pt II"
- In reply to: Jay B. Harlow [MVP - Outlook]: "Re: dateTime Manupulations"
- Next in thread: Herfried K. Wagner [MVP]: "Re: dateTime Manupulations"
- Reply: Herfried K. Wagner [MVP]: "Re: dateTime Manupulations"
- Reply: Jay B. Harlow [MVP - Outlook]: "Re: dateTime Manupulations"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|