Friday, November 1, 2019

Time Calculator

I don't know why there is no program, which is able to set source time and based on the time difference calculate destination's time.

LA is -16 hours slower than South Korea. To make comfortable time for each others, I had to calculate -16 hours but as you know I'm a programmer and lazy.

So I created a program to calculate for me.




Source is really simple.

===================================

public partial class frmTimeCalculator : Form
{
    public frmTimeCalculator()
    {
        InitializeComponent();
    }


    private void frmTimeCalculator_Load(object sender, EventArgs e)
    {
        sourceTime.CustomFormat = "MM/dd/yyyy hh:mm:ss tt";
        sourceTime.Format = DateTimePickerFormat.Custom;

        destTime.CustomFormat = "MM/dd/yyyy hh:mm:ss tt";
        destTime.Format = DateTimePickerFormat.Custom;
    }

    private void dateTimePicker1_ValueChanged(object sender, EventArgs e)
    {
        DateTime laTime = sourceTime.Value.AddHours(-16);
        destTime.Value = laTime;
    }
}

No comments:

Post a Comment

Task in UnrealEngine

 https://www.youtube.com/watch?v=1lBadANnJaw