473,473 Members | 1,460 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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
Nov 22 '05 #1
3 1110
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

Nov 22 '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

Nov 22 '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




Nov 22 '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
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
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...
0
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,...
0
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...
0
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,...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...
0
muto222
php
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.