472,358 Members | 1,642 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

timestamp in .net

Tom
Hi guys

How do I generate a timestamp in .net ?

I can't seem to find anything on it. I would've thought it would be in
DateTime but it isn't.

thanks
Tom
Jul 21 '05 #1
3 15468
Tom,

If you mean you want the current time try the static System.DateTime.Now
property:
DateTime now = System.DateTime.Now;
MessageBox.Show(now.ToString());

Otherwise, please explain a bit further what you want do to.

--
Regards,
Dennis JD Myrén
Oslo Kodebureau
"Tom" <to********@optushome.com.au> wrote in message
news:42***********************@news.optusnet.com.a u...
Hi guys

How do I generate a timestamp in .net ?

I can't seem to find anything on it. I would've thought it would be in
DateTime but it isn't.

thanks
Tom

Jul 21 '05 #2
For a string that is chronologically sortable, try this:
System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.ff")

"Tom" wrote:
Hi guys

How do I generate a timestamp in .net ?

I can't seem to find anything on it. I would've thought it would be in
DateTime but it isn't.

thanks
Tom

Jul 21 '05 #3
Tom
no time stamp as in
<messageTimestamp>20041803161306527000+660</messageTimestamp>


"Dennis Myrén" <de****@oslokb.no> wrote in message
news:e%****************@TK2MSFTNGP09.phx.gbl...
Tom,

If you mean you want the current time try the static System.DateTime.Now
property:
DateTime now = System.DateTime.Now;
MessageBox.Show(now.ToString());

Otherwise, please explain a bit further what you want do to.

--
Regards,
Dennis JD Myrén
Oslo Kodebureau
"Tom" <to********@optushome.com.au> wrote in message
news:42***********************@news.optusnet.com.a u...
Hi guys

How do I generate a timestamp in .net ?

I can't seem to find anything on it. I would've thought it would be in
DateTime but it isn't.

thanks
Tom




Jul 21 '05 #4

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

Similar topics

13
by: perplexed | last post by:
How do you convert a user inputted date to a unix timestamp before insterting it into your database? I have a form, with a textfield for a date that the user inputs in the format mm-dd-yyyy and...
2
by: Astra | last post by:
Hi All I know an SQL Server timestamp seems to be as useful as rocking horse for show jumping, but I'm hoping you know a 'fudge' to get me round a problem or at least confirm that it isn't...
2
by: rong.guo | last post by:
Hello Group, I am having a really weird problem... Can anyone tell the difference between Query 1 and Query 2 below? Why Query 2 excludes '2/28/2005'? Many thanks! create table a...
7
by: mybappy | last post by:
Hi: I am trying to use timestamp field of SQL Server to maintain concurrency. My problem is how do I store the timestamp value in my webform. The hidden field does not work as I get some cast...
2
by: Zygo Blaxell | last post by:
I have a table with a few million rows of temperature data keyed by timestamp. I want to group these rows by timestamp intervals (e.g. every 32 seconds), compute aggregate functions on the...
5
by: Prabu Subroto | last post by:
Dear my friends... I created some tables with field timestamp (datatype also timestamp). I mean, I want to have the data when each record inserted or modified in the tables. on MysQL, I just...
2
by: Russell Smith | last post by:
Timestamps support infinity. However if appears dates do not. When timestamps are cast to dates, there is no output. Is this an acceptable option or not? Below are a number of examples...
2
by: Reddog | last post by:
Hi all, I have a number of tables that I want 'timestamped' with both a modified and created 'timestamp' field. Ideally both fields should 'work if ignored' in insert and updates, thus the...
22
by: Mal Ball | last post by:
I hope I have the right forum for this question. I have an existing Windows application which uses a SQL Server database and stored procedures. I am now developing a web application to use the same...
7
by: JJ | last post by:
How do I set one field to have the updated timestamp, and another to have the created timestamp? I want to do this directly from code generated from DB Designer if possible?! JJ
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
1
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...

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.