473,753 Members | 6,868 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Lack of millisecond support in UniversalSortab leDateTimePatte rn

sgh
Why doesn't this date time pattern support milliseconds? That makes
it hard for me to map my date, time, and dateTime XML schema types to
System.DateTime values without losing millisecond precision. The
DateTime.ToStri ng("u") format specifier chops off the milliseconds of
my values

:(

Anybody got a work-around for this?
Nov 12 '05 #1
1 6309
"sgh" <sh*****@gmail. com> wrote in message news:3e******** *************** ***@posting.goo gle.com...
Why doesn't this date time pattern support milliseconds? : : DateTime.ToStri ng("u") format specifier chops off the milliseconds of
my values
UniversalSortab leDateTimePatte rn's purposefully supports the
'u' format specifier to format output. The governing standard is
ISO 8601. That standard states that a conformant date time may
or may not include fractional seconds.

Had 'u' formatted output with milliseconds, it would be producing
a representation of a date time that some ISO 8601 conformant
recipients may not understand, undercutting the interoperabilit y
of the format.

The .NET Framework fully supports custom date/time formats
(i.e., "pictures") . There's nothing to stop you from using,

"yyyy-MM-ddTHH:mm:ss.fff "

as a format specifier.
it hard for me to map my date, time, and dateTime XML schema types to
System.DateTime values without losing millisecond precision.
Format specifiers produce textual output; if you are mapping an
xsd:dateTime primitive type value to a CLR DateTime type, then
output isn't what you need.
Anybody got a work-around for this?


I think System.Globaliz ation is the wrong namespace to look at
for classes to go to/from primitive XML Schema Datatypes. If
you look in the System.Xml namespace, there is an XmlConvert
class that has all the functions you need for translating the
xsd:dateTime and related datatypes.

DateTime dt = XmlConvert.ToDa teTime( strDateTimeAttr ValueIn);
string strDateTimeAttr ValueOut = XmlConvert.ToSt ring( dt);

ToDateTime( ) and ToString( ) both preserve optional milliseconds
and timezone qualifiers that may be present.
Derek Harmon
Nov 12 '05 #2

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

Similar topics

8
22884
by: szymex | last post by:
How can I get current time in milliseconds in ASP?
8
46272
by: Macgyver | last post by:
Hi all, does anyone know how to generate a millisecond delay in C, compiling under Linux? I understand the function sleep() will generate a delay down to a resolution of one second, but I need to be able to refine this to milliseconds. Any ideas? Thanks in advance,
4
3184
by: Rob Schieber | last post by:
I am pretty frustrated with Microsoft and their lack of support with the Sproxy.exe tool included with VS.Net. Im using VS.Net EA and I wanted to create a C++ webreference to the Amazon.com web service: http://webservices.amazon.com/AWSECommerceService/AWSECommerceService.wsdl Now Sproxy.exe blows errors left and right when you try to add this. It seems that Sproxy doesn't now how to interpret attributes, lists, annotations etc... ...
269
1650
by: Montrose... | last post by:
After working in c# for a year, the only conclusion I can come to is that I wish I knew c. All I need is Linux, the gnu c compiler and I can do anything. Web services are just open sockets hooked up to interfaces. The Gtk is more than enough gui.
3
5487
by: aling | last post by:
Execute following T-SQL within Queary Analyzer of SQL Server 2000: ======================================= DECLARE @dTest DATETIME SET @dTest='2001-1-1 1:1:1:991' SELECT @dTest SET @dTest='2001-1-1 1:1:1:997' SELECT @dTest
4
5594
by: Manikandan | last post by:
Hi, I'm inserting a datetime values into sql server 2000 from c# SQL server table details Table name:date_test columnname datatype No int date_t DateTime C# coding
5
2418
by: Hunter | last post by:
Hi all, I know it may sound like dump newbie question (which is very much true, as I am a newbie, not even a real programmer), but I need to implement a calendar time clock with a millisecond resolution. For hours I've been digging the Visual C++ 6 help and Googling like a madman. It seems to me that the standard C just don't have the tool to get this type on information. Sure I found the time() and the clock() but they don't really...
1
2971
by: maul581 | last post by:
I know the delay( ) function of Turbo C and used it in my project. By this function we can give intermediate delay in execution from 1 millisecond to 9999 millisecond. My main question is "Is it possible to get delay less than 1 millisecond in Turbo C"? If by changin any header file (e.g. dos.h) or by creating my own "delay" function, at any way Can I get delay less than 1 millisecond? If in C it is not possible than please suggest me any...
0
2823
by: maolimix | last post by:
Hi to all, I have a trouble with datetime...now I explain.. I must to store to a C# variable the values from a "Datetime column" of Sql Server 2005. I tried 3 methods ...in the first two I never was able to get the Millisecond from datacolumn. I explain the methods... 1) I created a Datatable that contain the column... then I fill a datarow with the current value. The system automatically converts the Sqldatetime in System.Datetime but...
0
9072
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8896
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9451
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9421
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9333
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6869
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6151
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
2872
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2284
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.