Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

string.Format() help

1 view
Skip to first unread message

tolisss

unread,
Jun 2, 2006, 10:27:14 AM6/2/06
to
Hi i have a string like "22/5/2006 12:00:00 pµ" and i want to create
a string like "05/22/06"
could someone please

Claes Bergefall

unread,
Jun 2, 2006, 10:59:37 AM6/2/06
to
Take a look at DateTime.Parse and DateTime.ParseExact. Once you have a valid
DateTime object you can use its ToString method to format the output

/claes

"tolisss" <apostolis...@gmail.com> wrote in message
news:1149258434.1...@f6g2000cwb.googlegroups.com...
Hi i have a string like "22/5/2006 12:00:00 pľ" and i want to create

Lyny

unread,
Jun 2, 2006, 11:00:18 AM6/2/06
to
Try:
System.DateTime MyTime = System.DateTime.Now;

System.Console.WriteLine(MyTime.ToString("HH:mm:ss"));

Alain


"tolisss" <apostolis...@gmail.com> a écrit dans le message de news:
1149258434.1...@f6g2000cwb.googlegroups.com...
Hi i have a string like "22/5/2006 12:00:00 pľ" and i want to create

chanmm

unread,
Jun 2, 2006, 12:53:10 PM6/2/06
to
Hope this is detail enough for you:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/spptsdk/html/tsovOMGdlnsTime_SV01077681.asp

chanmm

"tolisss" <apostolis...@gmail.com> wrote in message
news:1149258434.1...@f6g2000cwb.googlegroups.com...

Hi i have a string like "22/5/2006 12:00:00 pต" and i want to create

tolisss

unread,
Jun 5, 2006, 4:06:39 AM6/5/06
to
supose i want a more generic method
suppose i do not know what type the format string is going to produce
is there a more generic format method? can;t use DateTime.Parse method
i want somethong like Type.Parse

Ο/Η Claes Bergefall έγραψε:


> Take a look at DateTime.Parse and DateTime.ParseExact. Once you have a valid
> DateTime object you can use its ToString method to format the output
>
> /claes
>
> "tolisss" <apostolis...@gmail.com> wrote in message
> news:1149258434.1...@f6g2000cwb.googlegroups.com...

> Hi i have a string like "22/5/2006 12:00:00 pµ" and i want to create

Göran Andersson

unread,
Jun 5, 2006, 6:56:19 AM6/5/06
to
If you wan't to parse any data type, then you have to be a bit more
specific about what kind of data you can expect, and how that should be
interpreted.

tolisss

unread,
Jun 5, 2006, 7:34:24 AM6/5/06
to
let me be a little more specific then i have this proerpty called
formatstring and a user can put in design mode any format string he
wants and the type representation.

but code doesn't know the type so to use the appropriate method

does that make any sense to u? how to procceed


Ο/Η Göran Andersson έγραψε:

Göran Andersson

unread,
Jun 6, 2006, 2:02:10 PM6/6/06
to
I think that you have to be even more specific. Try to explain what it
is that you are trying to accomplish, rather then how you think that it
should be done.
0 new messages