473,769 Members | 2,063 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 6313
"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
22885
by: szymex | last post by:
How can I get current time in milliseconds in ASP?
8
46275
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
3185
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
2419
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
2972
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
2824
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
9579
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
9416
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
10199
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8861
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6661
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();...
0
5293
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5433
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3948
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3551
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.