using ryCommon;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using WeifenLuo.WinFormsUI.Docking;

namespace 开发辅助工具.Tools
{
    public partial class FrmTime : DockContent
    {
        public FrmTime()
        {
            InitializeComponent();
            dateTimePickerEX1.Value = DateTime.Now.Date;

        }

        private void FrmTime_Load(object sender, EventArgs e)
        {

        }
        
        private void TxtFromUnixTime_TextChanged2(object sender, EventArgs e)
        {
            var dt =RyDate.UnixTimeToDateTime(TxtFromUnixTime.Text);
            TxtResultTime.Text = dt.ToString("yyyy-MM-dd dddd HH:mm:ss");
            TxtJSTime1.Text = RyDate.DateTimeToJSTime(dt).ToString();
        }

        private void DateTimePickerEX1_ValueChanged(object sender, EventArgs e)
        {
            TxtResultUnixTime.Text = RyDate.DateTimeToUnixTime(dateTimePickerEX1.Value).ToString();
            TxtJSTime2.Text = RyDate.DateTimeToJSTime(dateTimePickerEX1.Value).ToString();
        }

        private void TxtFromJSTime3_TextChanged2(object sender, EventArgs e)
        {
            var dt = RyDate.JSTimeToDateTime(TxtFromJSTime3.Text);
            TxtResultTime3.Text = dt.ToString("yyyy-MM-dd dddd HH:mm:ss");
            TxtUnixTime3.Text = RyDate.DateTimeToUnixTime(dt).ToString();
        }
    }
}
