DateTime Format in .NET

TeeChart for ActiveX, COM and ASP
Post Reply
MT64
Newbie
Newbie
Posts: 5
Joined: Mon Mar 08, 2004 5:00 am

DateTime Format in .NET

Post by MT64 » Sun Jul 04, 2004 7:45 am

Please advise me how to format bottom axis datetime data of TChartAx6 in VB.NET
for example
Dim P as integer
p = AxTChart1.Series(0).YValues.Locate(AxTChart1.Series(0).YValues.Minimum)

<--Both followings 2 line does not work-->

TextBox1.Text = Format(AxTChart1.Series(0).XValues.Value(p), "yy/mm/dd hh:mm")

TextBox1.Text = AxTChart1.Series(0).XValues.Value(p).ToString("yy/mm/dd hh:mm")

Thanks in advance.

Pep
Site Admin
Site Admin
Posts: 3303
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Mon Jul 05, 2004 9:42 am

Hi,

you can do this :

Code: Select all

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        TextBox1.Text = DateTime.FromOADate(AxTChart1.Series(0).XValues.Value(1)).ToString()
    End Sub

Post Reply