Date Literals That Include Milliseconds

N

Nathan Sokalski

I have a control uses the date and time, including milliseconds. I want to
be able to enter this information as an attribute in the *.aspx page.
Because all attributes are entered as strings in the *.aspx page, I need a
recognizable date/time string that includes the date and time, including
milliseconds. Can somebody tell me the best format to do this in? Thanks.
(NOTE: The date/time data is coming from a databound field from an SQL
Server database.)
 
C

Cor Ligthert[MVP]

Nathan,

Because there are so many processes bussy mostly, is the windows operating
system probably not that accurate that you can get the real time in
milliseconds.

However the datetime.millisecond gives something back what reaches that the
most, but that is not in a literal, so just appending the toString with the
& will probably be the best.

Cor
 
R

rowe_newsgroups

I have a control uses the date and time, including milliseconds. I want to
be able to enter this information as an attribute in the *.aspx page.
Because all attributes are entered as strings in the *.aspx page, I need a
recognizable date/time string that includes the date and time, including
milliseconds. Can somebody tell me the best format to do this in? Thanks.
(NOTE: The date/time data is coming from a databound field from an SQL
Server database.)

I believe you can use:

myDateTime.ToString("M/d/yyyy HH:mm:ss:fff")

To print a date something like:

8/27/2007 06:37:13:0257

Thanks,

Seth Rowe
 
R

rowe_newsgroups

See my first reply in this thread...

Sorry Mark - didn't realize I repeated you. Apparently, this
originally multiposted thread turned into a crossposted thread. All
your earlier posts are only on the
microsoft.public.dotnet.framework.aspnet newsgroup and not the
microsoft.public.dotnet.languages.vb newsgroup from which I am
posting.

Thanks,

Seth Rowe
 
M

Mark Rae [MVP]

Sorry Mark - didn't realize I repeated you. Apparently, this
originally multiposted thread turned into a crossposted thread. All
your earlier posts are only on the
microsoft.public.dotnet.framework.aspnet newsgroup and not the
microsoft.public.dotnet.languages.vb newsgroup from which I am
posting.

Ah right - the OP does have a habit of cross-posting, which I usually
correct if I remember...

X-posted deliberately to microsoft.public.dotnet.languages.vb
 
N

Nathan Sokalski

Did anybody read the Subject of this thread? It says Date LITERALS, not Date
Formatting. This means I want a Date String that already is a String that I
can assign to a Date Object. My reason for needing this is that I need to
declaratively assign a date to a Control Property in the *.aspx file using
Attributes. Any ideas? Thanks.
 
R

rowe_newsgroups

Did anybody read the Subject of this thread? It says Date LITERALS, not Date
Formatting.

Seth's first rule of newsgroups: Act like an ***hole - receive no more
help.

With that said, I consider this a warning and try to help you again.
This means I want a Date String that already is a String that I
can assign to a Date Object.

I don't see the problem - you can assign the string for the Control's
property like this:

<uc1:DateUC ID="theDateUC" runat="server" TheDateTime='8/29/2007
09:01:52.257' />

In my usercontrol I created the property looks like:

public DateTime TheDateTime {
get {
return DateTime.Parse(this.dateTimeLiteral.Text);
}
set {
this.dateTimeLiteral.Text = value.ToString("M/d/yyyy
HH:mm:ss:fff");
}
}

And everything showed up in my literal control just fine.

Thanks,

Seth Rowe
 
M

Mark Rae [MVP]

Seth's first rule of newsgroups: Act like an ***hole - receive no more
help.

The OP is well-known for that - he's a recent graduate who firmly believes
that the world owes him a living, and that these newsgroups are his own
private helpdesk...

Maybe he'll grow up one day...
 
R

rowe_newsgroups

The OP is well-known for that - he's a recent graduate who firmly believes
that the world owes him a living, and that these newsgroups are his own
private helpdesk...

Maybe he'll grow up one day...

Thanks for the warning Mark, I'd go ahead and killfile him now if I
didn't insist on using google groups as my newsreader.

Thanks,

Seth Rowe
 
C

Cor Ligthert[MVP]

Nathan,

Maybe you can next time write a message like your subject, putting "Wood" in
your subject and start than to write about "Bush" does not give good
information.

This is what you wrote.
milliseconds.

This does not mean (probably beside in your mind)

Although it is for me completely not to understand what you want.

A DateTime literal is fixed in one format, which is based on the USA time
and almost never usable in the rest of the world or by internet sites which
are not only for the USA (In fact can that be all COM, ORG, NET, TV and more
of those sites). Therefore it probably even for most not recognisable what
you want in these very much international newsgroups.

Outside the USA probably nobody uses them.

Cor

Nathan Sokalski said:
Did anybody read the Subject of this thread? It says Date LITERALS, not
Date Formatting. This means I want a Date String that already is a String
that I can assign to a Date Object. My reason for needing this is that I
need to declaratively assign a date to a Control Property in the *.aspx
file using Attributes. Any ideas? Thanks.
 

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

Top