DataTime string format

  • Thread starter Thread starter barry
  • Start date Start date
B

barry

Hi

does anyone know which format character i should use to get the the
following date string

2006-01-30T22:00:00.0000000-08:00

if i use 's' format i get
2006-01-30T22:00:00

TIA
Barry
 
Yes, the backslashes are not necessary. The colon character does not require
escaping.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
We got a sick zebra a hat,
you ultimate tuna.
 
Would have helped if I'd read the reference myself, wouldn't it?

Does anyone know, though - if I require the format given by the OP, and
I use the "/" and ":" characters for date/time separator, will they
change depending on the globalisation settings in use? I imagine the
date separator will, but is the semi-colon standard worldwide?


Kevin said:
Yes, the backslashes are not necessary. The colon character does not require
escaping.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
We got a sick zebra a hat,
you ultimate tuna.


Flinky Wisty Pomm said:
You need to build a custom date formatting string, I think. Reference
here
[http://msdn.microsoft.com/library/d...ide/html/cpconcustomdatetimeformatstrings.asp]
but it looks like you want

"yyyy-MM-dd\THH\:mm\:ss-fffffff-zzz"

some of the backslashes may be superfluous, but that's off the top of
my head, so I've erred on the side of caution.
 
Does anyone know, though - if I require the format given by the OP, and
I use the "/" and ":" characters for date/time separator, will they
change depending on the globalisation settings in use?

No, because what you will have afterwards is a string, not a DateTime.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
We got a sick zebra a hat,
you ultimate tuna.


Flinky Wisty Pomm said:
Would have helped if I'd read the reference myself, wouldn't it?

Does anyone know, though - if I require the format given by the OP, and
I use the "/" and ":" characters for date/time separator, will they
change depending on the globalisation settings in use? I imagine the
date separator will, but is the semi-colon standard worldwide?


Kevin said:
Yes, the backslashes are not necessary. The colon character does not
require
escaping.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
We got a sick zebra a hat,
you ultimate tuna.


Flinky Wisty Pomm said:
You need to build a custom date formatting string, I think. Reference
here
[http://msdn.microsoft.com/library/d...ide/html/cpconcustomdatetimeformatstrings.asp]
but it looks like you want

"yyyy-MM-dd\THH\:mm\:ss-fffffff-zzz"

some of the backslashes may be superfluous, but that's off the top of
my head, so I've erred on the side of caution.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top