Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


current time + 10 min in yyyy-mm-dd hh:mm format using

Posted on 2009-07-08
Medium Priority
Last Modified: 2013-11-08

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

Question by:ram27
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 53

Accepted Solution

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

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

Open in new window

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

LVL 60

Expert Comment

by:Kevin Cross
ID: 24803765
Ah, too slow. :)
Fill in the form and get your FREE NFR key NOW!

Veeam® is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.


Author Comment

ID: 24803816
hi Dhaest,

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

Expert Comment

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

Assisted Solution

by:Kevin Cross
Kevin Cross earned 600 total points
ID: 24803996
"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
LVL 86

Assisted Solution

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



    currentTime = currentTime.AddMinutes(10)

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
User art_snob ( encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : All lightning effects with instructions : http://www.mediaf…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

715 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