views:

1007

answers:

3

I'm hoping that someone has found a way of doing this already or that there is a library already in existence. It's one of those things that would be nice but is in no way necessary for the time being.

The functionality I'm looking for is something like datejs in reverse.

Thanks,

Simon.

A: 

http://msdn.microsoft.com/en-us/library/az4se3k1(VS.71).aspx should get you on your way,

mmiika
That doesn't really match the power of datejs does it?
David Kemp
Actually, it does, assuming you already have a datetime value. What datejs does that this won't it parse input strings.
Joel Coehoorn
What David meant was that the Standard Format strings have only a few pre-canned formats, instead of the "build-your-own" style of datejs (and the Custom format strings)
James Curran
+5  A: 

Actually, what you really want is the Custom DateTime Format strings: http://msdn.microsoft.com/en-us/library/8kb3ddd4(VS.71).aspx

DateTime.Now.ToString("ggyyyy$dd-MMM (dddd)")

will return "A.D.2008$06-Nov (Thursday)" if that's what you want.

And to get something closr to datejs ("in forward"), you can use the same strings in DateTime.ParseExact()

James Curran
A: 

Thanks, using something like the dddd example might be a good start towards usability. The more I think about this problem the more it depends on the values being used. I'm specifically dealing with a series of timestamped versions of a document so there is a good chance that they will be clustered. Today isn't so hot if you have saved it three times in the last five minutes.

If I come up with something I'll share it with the community.

Simon Farrow