.NET Framework Developer Center > Using Forums Forums > Off-Topic Posts (Do Not Post Here) > how to display time value based on width of the line
Ask a questionAsk a question
 

Proposed Answerhow to display time value based on width of the line

  • Friday, November 06, 2009 9:49 PMManasMSDN Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    hi,

    how can i display time on a line based on its width

    if i
    case 1: increase the line width, time value s should be interms of  minutes and seconds
    case 2: decrease the line width, time values  should be interms of  hours and minutes
    case 3: days
    case 4: months like that


    any formula plz help me!

    thanx in advance
    • Edited byManasMSDN Friday, November 06, 2009 9:49 PMdescription
    • Edited byManasMSDN Friday, November 06, 2009 10:11 PMtext
    • Moved byeryangMSFTThursday, November 12, 2009 8:02 AM (From:.NET Base Class Library)
    •  

All Replies

  • Saturday, November 07, 2009 7:04 PMDeborahKMVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Has Code
    There is an Add method for a date that you can use to increase a date by minutes, seconds, hours, or whatever.

    Here is an example:

            Dim dt1 As DateTime
            dt1 = DateTime.Now
            dt1 = dt1.AddDays(2)
            Debug.WriteLine(dt1.ToString)
    


    Hope this helps.
    www.insteptech.com ; msmvps.com/blogs/deborahk
    We are volunteers and ask only that if we are able to help you, that you mark our reply as your answer. THANKS!
  • Monday, November 09, 2009 2:02 AMkonikula Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Use myDate.Format(formatString)

    for example Now().Format("HH\:mm") will writeout current time in 24 short format

    check out custom format strings
    http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx

    you may also know that each valuetype (integer, double, timespan, time) has custom format strings which are very usefull time from time...

    Cheers, Matt
  • Monday, November 09, 2009 3:14 PMManasMSDN Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Hi,

    i am talking about , GDI+ stuff.

    how to draw a line based on time values.

    how can i display time on a line based on its width

    if i
    case 1: increase the line width, time value s should be interms of  minutes and seconds
    case 2: decrease the line width, time values  should be interms of  hours and minutes
    case 3: days
    case 4: months like that

  • Wednesday, November 11, 2009 6:51 AMeryangMSFTUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi,
    If you are interested in GDI+ technology, you can consider posting it at GDI+ related forum for quicker and better support.

    Thanks,
    Eric
    Please remember to mark helpful replies as answers and unmark them if they provide no help.
  • Wednesday, November 18, 2009 10:47 PMManasMSDN Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    hi,

    can anyone tell me where is the link   for GDI+ Forum.
    thanks

  • Thursday, November 19, 2009 6:12 AMSaju Mathew Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Proposed Answer
    May be you can raise this in Windows Forms General

    http://social.msdn.microsoft.com/Forums/en-US/winforms

    • Proposed As Answer bySaju Mathew Monday, November 23, 2009 4:44 AM
    •