Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

current time + 10 min in yyyy-mm-dd hh:mm format using asp.net/vb.net

Posted on 2009-07-08
7
Medium Priority
?
553 Views
Last Modified: 2013-11-08
Hi

i want to get current system time+10 minutes   in yyyy-MM-dd HH:mm using asp.net/vb.net
i am using .net 3.5 .

Thanks,
0
Comment
Question by:ram27
7 Comments
 
LVL 53

Accepted Solution

by:
Dhaest earned 1200 total points
ID: 24803739
You can try this:

Dim currentTime As DateTime = DateTime.Now 
currentTime.AddMinutes(10) 
Dim printDate As String = currentTime.ToString("yyyy-MM-dd HH:mm") 

Open in new window

0
 
LVL 60

Assisted Solution

by:Kevin Cross
Kevin Cross earned 600 total points
ID: 24803757
You can use the AddMinutes method of DateTime object and then use ToString with format you want.
Dim now As DateTime = DateTime.Now
        MsgBox(now.AddMinutes(10).ToString("yyyy-MM-dd HH:mm"))

Open in new window

0
 
LVL 60

Expert Comment

by:Kevin Cross
ID: 24803765
Ah, too slow. :)
0
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 

Author Comment

by:ram27
ID: 24803816
hi Dhaest,

i want time in 24hrs format ex: 2009-07-08 20:10 etc.. can you please help
0
 
LVL 53

Expert Comment

by:Dhaest
ID: 24803837
It is in 24hrs format ...
0
 
LVL 60

Assisted Solution

by:Kevin Cross
Kevin Cross earned 600 total points
ID: 24803996
Agreed!
"yyyy-MM-dd HH:mm" == 24 hour clock w/ leading zero (single H removes leading zero)
"yyyy-MM-dd hh:mm" == 12 hour clock w/ leading zero
0
 
LVL 86

Assisted Solution

by:Mike Tomlinson
Mike Tomlinson earned 200 total points
ID: 24804464
*In Dhaest's example, you need to change:

    currentTime.AddMinutes(10)

To:

    currentTime = currentTime.AddMinutes(10)
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

886 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question