473,394 Members | 1,800 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

DataTime string format

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
Feb 14 '06 #1
4 977
You need to build a custom date formatting string, I think. Reference
here
[http://msdn.microsoft.com/library/de...atstrings.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.

Feb 14 '06 #2
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" <Pa********@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
You need to build a custom date formatting string, I think. Reference
here
[http://msdn.microsoft.com/library/de...atstrings.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.

Feb 14 '06 #3
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 Spencer wrote:
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" <Pa********@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
You need to build a custom date formatting string, I think. Reference
here
[http://msdn.microsoft.com/library/de...atstrings.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.


Feb 14 '06 #4
> 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" <Pa********@gmail.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com... 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 Spencer wrote:
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" <Pa********@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
> You need to build a custom date formatting string, I think. Reference
> here
> [http://msdn.microsoft.com/library/de...atstrings.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.
>

Feb 14 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Sun | last post by:
Hi all, I am inserting datatime value into mysql table, while select value its giving 0000-00-00 00:00:00 value. mysql> insert into dtest values('02-17-05 17:08:02'); Query OK, 1 row...
8
by: Zibi | last post by:
I have some problem with datatime. SELECT * FROM stat WHERE data > '2005-05-24 14:07:28' ORDER BY id Asc I got the error: Microsoft OLE DB Provider for SQL Server error '80040e07' The...
14
by: expertware | last post by:
Ok! to avoid confusion I will start a new argument. Thanks!! FIREFOX 1.0.7 AND IE6 viewed through DATATIME: a summary REPORT ===============================================================...
3
by: Quentin Huo | last post by:
Hi: I have a string which value has the date format, like "Wed, 15 Sep 2004 15:52:36 GMT", and I want to create an object of DateTime, like: DateTime dt = (DateTime)(theDateString);
0
by: Karunakararao | last post by:
Hi All I Need Datetime pattern Based on regional optional setting . in web application This iam getting in window application ,It's not getting in web application Label1.Text =...
3
by: Dominique Vandensteen | last post by:
after the very small & vs string.format discussion I did some speed tests... loop of 1.000.000 concatenations of 5 public string variables in a class gave following results: result = a & b...
4
by: David Morris | last post by:
Hi Could somebody please explain what the following line of code means String.Format("{0}\{1}.{2:00}", C:\, myfile.txt, 1 It's actually the first argument that I don't understand. What is...
8
by: Lucky | last post by:
hi guys! back again with another query. the problem is like this. i want to print a line like this: "---------------------------------------------" the easiest way is to simply assign it to...
3
by: =?Utf-8?B?QnJpYW4gUi4=?= | last post by:
We are working with a system (black box to us) that provides date/time in the following string format: "Tues Sep 30 15:16:41 PDT 2008" Where PDT is the local time zone. We need to parse...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
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,...
0
tracyyun
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.