Source Code selisih Tanggal
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace selisih_tanggal
{
public partial class Form1 : Form
{
DateTime tanggal1;
DateTime tanggal2;
TimeSpan hasil;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
tanggal1 = dateTimePicker1.Value;
tanggal2 = dateTimePicker2.Value;
hasil = tanggal2.Subtract (tanggal1);
}
private void button1_Click(object sender, EventArgs e)
{
textBox1.Text = hasil.ToString();
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
}
}
Tidak ada komentar:
Posting Komentar