PC Review


Reply
Thread Tools Rate Thread

Can System.DateTime.Now get seconds also?

 
 
Trint Smith
Guest
Posts: n/a
 
      19th Feb 2004
I know that System.DateTime.Now doesn't have the seconds and looks like
this:
("2/19/04 05:39 PM")
Can I get the seconds also, so that it looks like this?:
("2/19/04 05:39:19 PM")
With seconds added---^^
Thanks,
Trint


.Net programmer
(E-Mail Removed)

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
 
 
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      19th Feb 2004
* Trint Smith <(E-Mail Removed)> scripsit:
> I know that System.DateTime.Now doesn't have the seconds and looks like
> this:
> ("2/19/04 05:39 PM")
> Can I get the seconds also, so that it looks like this?:
> ("2/19/04 05:39:19 PM")
> With seconds added---^^


Have a look at its 'ToString' method:

<http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemDateTimeClassToStringTopic1.asp>

Format strings:

<http://msdn.microsoft.com/library/en-us/cpguide/html/cpcondatetimeformatstrings.asp>

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Strip out seconds from a Datetime dandc0711 Microsoft Access Queries 12 14th Jan 2010 08:14 PM
supress seconds for datetime iccsi Microsoft Access Form Coding 2 10th Jun 2008 06:58 PM
removing seconds from System.DateTime.Today.Now =?Utf-8?B?UHVyZSBIZWFydA==?= Microsoft Dot NET 2 22nd Sep 2007 08:37 PM
datetime seconds Chuck Hecht Microsoft Dot NET Compact Framework 6 10th Jul 2007 04:50 PM
Subtracting seconds from Datetime Paulers Microsoft VB .NET 2 29th Jun 2007 09:09 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:05 AM.